Browse Source

fix: avoid breaking avoriaz edge case

Evan You 7 năm trước cách đây
mục cha
commit
9011b83db7
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  1. 3 1
      src/core/vdom/helpers/normalize-scoped-slots.js

+ 3 - 1
src/core/vdom/helpers/normalize-scoped-slots.js

@@ -32,7 +32,9 @@ export function normalizeScopedSlots (
       res[key] = proxyNormalSlot(normalSlots, key)
     }
   }
-  if (slots) {
+  // avoriaz seems to mock a non-extensible $scopedSlots object
+  // and when that is passed down this would cause an error
+  if (Object.isExtensible(slots)) {
     (slots: any)._normalized = res
   }
   def(res, '$stable', slots ? !!slots.$stable : true)