]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: remove use of Object.assign
authorEvan You <yyx990803@gmail.com>
Tue, 12 Apr 2022 07:22:11 +0000 (15:22 +0800)
committerEvan You <yyx990803@gmail.com>
Tue, 12 Apr 2022 07:22:11 +0000 (15:22 +0800)
TS already transpiles spread to Object.assign with target:es2016

packages/reactivity/src/effect.ts
packages/runtime-core/src/apiCreateApp.ts
packages/runtime-core/src/apiWatch.ts

index 61894ebc2ec71cedefb6dba828e39445e5b0e41c..b69b238975ea8668f5563de9d529779bb6e97aa3 100644 (file)
@@ -237,14 +237,10 @@ export function trackEffects(
     dep.add(activeEffect!)
     activeEffect!.deps.push(dep)
     if (__DEV__ && activeEffect!.onTrack) {
-      activeEffect!.onTrack(
-        Object.assign(
-          {
-            effect: activeEffect!
-          },
-          debuggerEventExtraInfo
-        )
-      )
+      activeEffect!.onTrack({
+        effect: activeEffect!,
+        ...debuggerEventExtraInfo!
+      })
     }
   }
 }
index 98eb8fc844ff96a2fb55e3a1555e43a52405aa1c..8b437f2bfd1968425e803c5525181faf7180e5c7 100644 (file)
@@ -179,7 +179,6 @@ export function createAppAPI<HostElement>(
   hydrate?: RootHydrateFunction
 ): CreateAppFunction<HostElement> {
   return function createApp(rootComponent, rootProps = null) {
-
     if (!isFunction(rootComponent)) {
       rootComponent = { ...rootComponent }
     }
index fd09c7434e317f9aa41050b08b03cdf182b9a9ee..881a04a6645677674bfdf1d07dc5947fc269d8c7 100644 (file)
@@ -92,7 +92,7 @@ export function watchPostEffect(
     effect,
     null,
     (__DEV__
-      ? Object.assign(options || {}, { flush: 'post' })
+      ? { ...options, flush: 'post' }
       : { flush: 'post' }) as WatchOptionsBase
   )
 }
@@ -105,7 +105,7 @@ export function watchSyncEffect(
     effect,
     null,
     (__DEV__
-      ? Object.assign(options || {}, { flush: 'sync' })
+      ? { ...options, flush: 'sync' }
       : { flush: 'sync' }) as WatchOptionsBase
   )
 }