From: Evan You Date: Tue, 20 Aug 2019 18:28:44 +0000 (-0400) Subject: wip: remove immutability conversion in inject X-Git-Tag: v3.0.0-alpha.0~907 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5558b7ed18bb99be520cf0c4e4aa7c4fac67770;p=thirdparty%2Fvuejs%2Fcore.git wip: remove immutability conversion in inject --- diff --git a/packages/runtime-core/src/apiInject.ts b/packages/runtime-core/src/apiInject.ts index c5f40a7f3e..93d5e39a1d 100644 --- a/packages/runtime-core/src/apiInject.ts +++ b/packages/runtime-core/src/apiInject.ts @@ -1,6 +1,4 @@ import { currentInstance } from './component' -import { immutable } from './apiReactivity' -import { isObject } from '@vue/shared' export interface InjectionKey extends Symbol {} @@ -31,8 +29,8 @@ export function inject(key: InjectionKey | string, defaultValue?: any) { } else { // TODO should also check for app-level provides const provides = currentInstance.parent && currentInstance.provides - const val = - provides && key in provides ? (provides[key as any] as any) : defaultValue - return __DEV__ && isObject(val) ? immutable(val) : val + return provides && key in provides + ? (provides[key as any] as any) + : defaultValue } }