]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip: remove immutability conversion in inject
authorEvan You <yyx990803@gmail.com>
Tue, 20 Aug 2019 18:28:44 +0000 (14:28 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 20 Aug 2019 18:28:44 +0000 (14:28 -0400)
packages/runtime-core/src/apiInject.ts

index c5f40a7f3e742a779ff6a920202e001ed07f3c59..93d5e39a1d94718192aedc760eb07c02c688098d 100644 (file)
@@ -1,6 +1,4 @@
 import { currentInstance } from './component'
-import { immutable } from './apiReactivity'
-import { isObject } from '@vue/shared'
 
 export interface InjectionKey<T> extends Symbol {}
 
@@ -31,8 +29,8 @@ export function inject(key: InjectionKey<any> | 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
   }
 }