From c5558b7ed18bb99be520cf0c4e4aa7c4fac67770 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 20 Aug 2019 14:28:44 -0400 Subject: [PATCH] wip: remove immutability conversion in inject --- packages/runtime-core/src/apiInject.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/runtime-core/src/apiInject.ts b/packages/runtime-core/src/apiInject.ts index c5f40a7f..93d5e39a 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 } }