From: Evan You Date: Mon, 17 Feb 2020 16:02:15 +0000 (-0500) Subject: build: make watch tree-shakable in lean build X-Git-Tag: v3.0.0-alpha.5~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c1fe72dcf1d688fabf3b2b420dbe08da116a2ca;p=thirdparty%2Fvuejs%2Fcore.git build: make watch tree-shakable in lean build --- diff --git a/packages/runtime-core/src/componentProxy.ts b/packages/runtime-core/src/componentProxy.ts index 5d8d4364a6..b2ff4baada 100644 --- a/packages/runtime-core/src/componentProxy.ts +++ b/packages/runtime-core/src/componentProxy.ts @@ -1,7 +1,7 @@ import { ComponentInternalInstance, Data, Emit } from './component' import { nextTick, queueJob } from './scheduler' import { instanceWatch } from './apiWatch' -import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted } from '@vue/shared' +import { EMPTY_OBJ, hasOwn, isGloballyWhitelisted, NOOP } from '@vue/shared' import { ExtractComputedReturns, ComponentOptionsBase, @@ -63,7 +63,7 @@ const publicPropertiesMap: Record< $options: i => i.type, $forceUpdate: i => () => queueJob(i.update), $nextTick: () => nextTick, - $watch: i => instanceWatch.bind(i) + $watch: __FEATURE_OPTIONS__ ? i => instanceWatch.bind(i) : NOOP } const enum AccessTypes {