From 5ab028a9128b289b0c840bdb6901021fc482e6f5 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 21 Dec 2018 12:26:24 -0500 Subject: [PATCH] refactor: speed up injection resolution --- src/core/instance/inject.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/instance/inject.js b/src/core/instance/inject.js index e464e12a99..b04184e516 100644 --- a/src/core/instance/inject.js +++ b/src/core/instance/inject.js @@ -41,14 +41,13 @@ export function resolveInject (inject: any, vm: Component): ?Object { // inject is :any because flow is not smart enough to figure out cached const result = Object.create(null) const keys = hasSymbol - ? Reflect.ownKeys(inject).filter(key => { - /* istanbul ignore next */ - return Object.getOwnPropertyDescriptor(inject, key).enumerable - }) + ? Reflect.ownKeys(inject) : Object.keys(inject) for (let i = 0; i < keys.length; i++) { const key = keys[i] + // #6574 in case the inject object is observed... + if (key === '__ob__') continue const provideKey = inject[key].from let source = vm while (source) {