]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: do not warn about reserved methods
authorEvan You <yyx990803@gmail.com>
Fri, 2 Nov 2018 20:40:20 +0000 (05:40 +0900)
committerEvan You <yyx990803@gmail.com>
Fri, 2 Nov 2018 20:40:31 +0000 (05:40 +0900)
packages/runtime-core/src/componentProxy.ts

index 80bd36cb8024d4b15369f29101c859c8a1d007ea..e9cc3cadcb46439353f40216f33a77b91d5a12cb 100644 (file)
@@ -3,6 +3,7 @@ import { isFunction, isReservedKey } from '@vue/shared'
 import { warn } from './warning'
 import { isRendering } from './componentUtils'
 import { isObservable } from '@vue/observer'
+import { reservedMethods } from '@vue/runtime-dom'
 
 const bindCache = new WeakMap()
 
@@ -41,7 +42,12 @@ const renderProxyHandlers = {
       // hooks injections
       return i[key]
     } else if (key[0] !== '_') {
-      if (__DEV__ && isRendering && !(key in target)) {
+      if (
+        __DEV__ &&
+        isRendering &&
+        !(key in target) &&
+        !(key in reservedMethods)
+      ) {
         warn(
           `property "${key}" was accessed during render but does not exist ` +
             `on instance.`