build: further shave off runtime compile only code
This commit is contained in:
@@ -48,7 +48,7 @@ const publicPropertiesMap = {
|
||||
$options: 'type'
|
||||
}
|
||||
|
||||
export const PublicInstanceProxyHandlers = {
|
||||
export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
|
||||
get(target: ComponentInternalInstance, key: string) {
|
||||
const { renderContext, data, props, propsProxy } = target
|
||||
if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
||||
@@ -76,11 +76,7 @@ export const PublicInstanceProxyHandlers = {
|
||||
}
|
||||
return target.user[key]
|
||||
},
|
||||
// this trap is only called in browser-compiled render functions that use
|
||||
// `with (this) {}`
|
||||
has(_: any, key: string): boolean {
|
||||
return key[0] !== '_' && !globalsWhitelist.has(key)
|
||||
},
|
||||
|
||||
set(target: ComponentInternalInstance, key: string, value: any): boolean {
|
||||
const { data, renderContext } = target
|
||||
if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
||||
@@ -105,3 +101,11 @@ export const PublicInstanceProxyHandlers = {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
if (__RUNTIME_COMPILE__) {
|
||||
// this trap is only called in browser-compiled render functions that use
|
||||
// `with (this) {}`
|
||||
PublicInstanceProxyHandlers.has = (_: any, key: string): boolean => {
|
||||
return key[0] !== '_' && !globalsWhitelist.has(key)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user