]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(effect): use includes instead of indexOf (#286)
author夜宴 <1996yeyan@gmail.com>
Tue, 15 Oct 2019 15:18:26 +0000 (10:18 -0500)
committerEvan You <yyx990803@gmail.com>
Tue, 15 Oct 2019 15:18:26 +0000 (11:18 -0400)
packages/reactivity/src/effect.ts

index 289010f95144282a059a34f9702cba1c97a1e5d1..3350bc1a6371bfdc4bcd47c06b081e5efc91ed32 100644 (file)
@@ -88,7 +88,7 @@ function run(effect: ReactiveEffect, fn: Function, args: any[]): any {
   if (!effect.active) {
     return fn(...args)
   }
-  if (activeReactiveEffectStack.indexOf(effect) === -1) {
+  if (!activeReactiveEffectStack.includes(effect)) {
     cleanup(effect)
     try {
       activeReactiveEffectStack.push(effect)