Răsfoiți Sursa

fix proxy has return value

Evan You 10 ani în urmă
părinte
comite
79e164084b
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      src/runtime/instance/proxy.js

+ 3 - 2
src/runtime/instance/proxy.js

@@ -16,13 +16,14 @@ if (process.env.NODE_ENV !== 'production') {
   proxyHandlers = {
     has (target, key) {
       const has = key in target
-      if (!has && !allowedGlobals(key)) {
+      const isAllowedGlobal = allowedGlobals(key)
+      if (!has && !isAllowedGlobal) {
         warn(
           `Trying to access non-existent property "${key}" while rendering.`,
           target
         )
       }
-      return has
+      return !isAllowedGlobal
     }
   }