Browse Source

fix(runtime-core): avoid infinite warning loop for isRef check on component public proxy

fix #1091
Evan You 6 years ago
parent
commit
62336085f4
1 changed files with 8 additions and 1 deletions
  1. 8 1
      packages/runtime-core/src/componentProxy.ts

+ 8 - 1
packages/runtime-core/src/componentProxy.ts

@@ -194,7 +194,14 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
       hasOwn(globalProperties, key))
     ) {
       return globalProperties[key]
-    } else if (__DEV__ && currentRenderingInstance) {
+    } else if (
+      __DEV__ &&
+      currentRenderingInstance &&
+      // #1091 avoid isRef/isVNode checks on component instance leading to
+      // infinite warning loop
+      key !== '_isRef' &&
+      key !== '_isVNode'
+    ) {
       if (data !== EMPTY_OBJ && key[0] === '$' && hasOwn(data, key)) {
         warn(
           `Property ${JSON.stringify(