]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: rename `onDispose` to `onScopeDispose` in warnings and tests (#4355)
authorHaoqun Jiang <haoqunjiang@gmail.com>
Mon, 16 Aug 2021 22:19:06 +0000 (06:19 +0800)
committerGitHub <noreply@github.com>
Mon, 16 Aug 2021 22:19:06 +0000 (18:19 -0400)
packages/reactivity/__tests__/effectScope.spec.ts
packages/reactivity/src/effectScope.ts

index 6028882772f1bfb93b468990d1bd6653d9a96115..9eac6da1ac600a852da40b642de3c3a0e20c66e6 100644 (file)
@@ -173,7 +173,7 @@ describe('reactivity/effect/scope', () => {
     expect(doubled).toBe(undefined)
   })
 
-  it('should fire onDispose hook', () => {
+  it('should fire onScopeDispose hook', () => {
     let dummy = 0
 
     const scope = new EffectScope()
@@ -192,7 +192,7 @@ describe('reactivity/effect/scope', () => {
     expect(dummy).toBe(7)
   })
 
-  it('should warn onDispose() is called when there is no active effect scope', () => {
+  it('should warn onScopeDispose() is called when there is no active effect scope', () => {
     const spy = jest.fn()
     const scope = new EffectScope()
     scope.run(() => {
@@ -204,7 +204,7 @@ describe('reactivity/effect/scope', () => {
     onScopeDispose(spy)
 
     expect(
-      '[Vue warn] onDispose() is called when there is no active effect scope to be associated with.'
+      '[Vue warn] onScopeDispose() is called when there is no active effect scope to be associated with.'
     ).toHaveBeenWarned()
 
     scope.stop()
index 05a700be43e57ddf004bcade6596ec1497bdb63c..864443f85b8de02552fba83be17de368db3d74a6 100644 (file)
@@ -98,7 +98,7 @@ export function onScopeDispose(fn: () => void) {
     activeEffectScope.cleanups.push(fn)
   } else if (__DEV__) {
     warn(
-      `onDispose() is called when there is no active effect scope` +
+      `onScopeDispose() is called when there is no active effect scope` +
         ` to be associated with.`
     )
   }