refactor: remove use of Object.assign

TS already transpiles spread to Object.assign with target:es2016
This commit is contained in:
Evan You 2022-04-12 15:22:11 +08:00
parent d121a9bc7e
commit 7efb9dba30
3 changed files with 6 additions and 11 deletions

View File

@ -237,14 +237,10 @@ export function trackEffects(
dep.add(activeEffect!) dep.add(activeEffect!)
activeEffect!.deps.push(dep) activeEffect!.deps.push(dep)
if (__DEV__ && activeEffect!.onTrack) { if (__DEV__ && activeEffect!.onTrack) {
activeEffect!.onTrack( activeEffect!.onTrack({
Object.assign( effect: activeEffect!,
{ ...debuggerEventExtraInfo!
effect: activeEffect! })
},
debuggerEventExtraInfo
)
)
} }
} }
} }

View File

@ -179,7 +179,6 @@ export function createAppAPI<HostElement>(
hydrate?: RootHydrateFunction hydrate?: RootHydrateFunction
): CreateAppFunction<HostElement> { ): CreateAppFunction<HostElement> {
return function createApp(rootComponent, rootProps = null) { return function createApp(rootComponent, rootProps = null) {
if (!isFunction(rootComponent)) { if (!isFunction(rootComponent)) {
rootComponent = { ...rootComponent } rootComponent = { ...rootComponent }
} }

View File

@ -92,7 +92,7 @@ export function watchPostEffect(
effect, effect,
null, null,
(__DEV__ (__DEV__
? Object.assign(options || {}, { flush: 'post' }) ? { ...options, flush: 'post' }
: { flush: 'post' }) as WatchOptionsBase : { flush: 'post' }) as WatchOptionsBase
) )
} }
@ -105,7 +105,7 @@ export function watchSyncEffect(
effect, effect,
null, null,
(__DEV__ (__DEV__
? Object.assign(options || {}, { flush: 'sync' }) ? { ...options, flush: 'sync' }
: { flush: 'sync' }) as WatchOptionsBase : { flush: 'sync' }) as WatchOptionsBase
) )
} }