From: Evan You Date: Mon, 19 Aug 2019 19:01:50 +0000 (-0400) Subject: fix: reactive and immutable should warn for undefined X-Git-Tag: v3.0.0-alpha.0~917 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e53874f7e72a50fa41e050198521b3a964b83659;p=thirdparty%2Fvuejs%2Fcore.git fix: reactive and immutable should warn for undefined --- diff --git a/packages/reactivity/src/reactive.ts b/packages/reactivity/src/reactive.ts index a965ceac57..e09882bba8 100644 --- a/packages/reactivity/src/reactive.ts +++ b/packages/reactivity/src/reactive.ts @@ -42,7 +42,7 @@ const canObserve = (value: any): boolean => { type ObservableFactory = (target?: T) => UnwrapRef -export const reactive = ((target: any = {}): any => { +export const reactive = ((target: unknown): any => { // if trying to observe an immutable proxy, return the immutable version. if (immutableToRaw.has(target)) { return target @@ -60,7 +60,7 @@ export const reactive = ((target: any = {}): any => { ) }) as ObservableFactory -export const immutable = ((target: any = {}): any => { +export const immutable = ((target: unknown): any => { // value is a mutable observable, retrive its original and return // a readonly version. if (observedToRaw.has(target)) {