Explorar el Código

fix proxy has return value

Evan You hace 10 años
padre
commit
79e164084b
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  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
     }
   }