]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: reactive and immutable should warn for undefined
authorEvan You <yyx990803@gmail.com>
Mon, 19 Aug 2019 19:01:50 +0000 (15:01 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 19 Aug 2019 19:01:50 +0000 (15:01 -0400)
packages/reactivity/src/reactive.ts

index a965ceac57aad6dc1e0c6c055567f5039b35d155..e09882bba80eab87c4d6933abb0967ec878179b1 100644 (file)
@@ -42,7 +42,7 @@ const canObserve = (value: any): boolean => {
 
 type ObservableFactory = <T>(target?: T) => UnwrapRef<T>
 
-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)) {