Просмотр исходного кода

perf(core): prevent iteration of arrays that should not be observable (#6467)

close #6284
fenduru 8 лет назад
Родитель
Сommit
aa820cba37
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/core/observer/index.js

+ 1 - 1
src/core/observer/index.js

@@ -157,7 +157,7 @@ export function defineReactive (
         if (childOb) {
           childOb.dep.depend()
         }
-        if (Array.isArray(value)) {
+        if (Array.isArray(value) && Object.isExtensible(value)) {
           dependArray(value)
         }
       }