Sfoglia il codice sorgente

avoid traversing frozen objects in deep watch (close #3147)

Evan You 10 anni fa
parent
commit
f3e2a12e5f
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/watcher.js

+ 1 - 1
src/watcher.js

@@ -343,7 +343,7 @@ function traverse (val, seen) {
   }
   const isA = isArray(val)
   const isO = isObject(val)
-  if (isA || isO) {
+  if ((isA || isO) && Object.isExtensible(val)) {
     if (val.__ob__) {
       var depId = val.__ob__.dep.id
       if (seen.has(depId)) {