parent
020851e57d
commit
a95e612b25
|
@ -25,7 +25,7 @@ import {
|
||||||
} from '../babelUtils'
|
} from '../babelUtils'
|
||||||
import { advancePositionWithClone, isSimpleIdentifier } from '../utils'
|
import { advancePositionWithClone, isSimpleIdentifier } from '../utils'
|
||||||
import {
|
import {
|
||||||
isGloballyWhitelisted,
|
isGloballyAllowed,
|
||||||
makeMap,
|
makeMap,
|
||||||
hasOwn,
|
hasOwn,
|
||||||
isString,
|
isString,
|
||||||
|
@ -225,7 +225,7 @@ export function processExpression(
|
||||||
|
|
||||||
if (isSimpleIdentifier(rawExp)) {
|
if (isSimpleIdentifier(rawExp)) {
|
||||||
const isScopeVarReference = context.identifiers[rawExp]
|
const isScopeVarReference = context.identifiers[rawExp]
|
||||||
const isAllowedGlobal = isGloballyWhitelisted(rawExp)
|
const isAllowedGlobal = isGloballyAllowed(rawExp)
|
||||||
const isLiteral = isLiteralWhitelisted(rawExp)
|
const isLiteral = isLiteralWhitelisted(rawExp)
|
||||||
if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
|
if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
|
||||||
// const bindings exposed from setup can be skipped for patching but
|
// const bindings exposed from setup can be skipped for patching but
|
||||||
|
@ -358,7 +358,7 @@ export function processExpression(
|
||||||
|
|
||||||
function canPrefix(id: Identifier) {
|
function canPrefix(id: Identifier) {
|
||||||
// skip whitelisted globals
|
// skip whitelisted globals
|
||||||
if (isGloballyWhitelisted(id.name)) {
|
if (isGloballyAllowed(id.name)) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
// special case for webpack compilation
|
// special case for webpack compilation
|
||||||
|
|
|
@ -9,7 +9,7 @@ import { instanceWatch, WatchOptions, WatchStopHandle } from './apiWatch'
|
||||||
import {
|
import {
|
||||||
EMPTY_OBJ,
|
EMPTY_OBJ,
|
||||||
hasOwn,
|
hasOwn,
|
||||||
isGloballyWhitelisted,
|
isGloballyAllowed,
|
||||||
NOOP,
|
NOOP,
|
||||||
extend,
|
extend,
|
||||||
isString,
|
isString,
|
||||||
|
@ -511,7 +511,7 @@ export const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend(
|
||||||
return PublicInstanceProxyHandlers.get!(target, key, target)
|
return PublicInstanceProxyHandlers.get!(target, key, target)
|
||||||
},
|
},
|
||||||
has(_: ComponentRenderContext, key: string) {
|
has(_: ComponentRenderContext, key: string) {
|
||||||
const has = key[0] !== '_' && !isGloballyWhitelisted(key)
|
const has = key[0] !== '_' && !isGloballyAllowed(key)
|
||||||
if (__DEV__ && !has && PublicInstanceProxyHandlers.has!(_, key)) {
|
if (__DEV__ && !has && PublicInstanceProxyHandlers.has!(_, key)) {
|
||||||
warn(
|
warn(
|
||||||
`Property ${JSON.stringify(
|
`Property ${JSON.stringify(
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { makeMap } from './makeMap'
|
import { makeMap } from './makeMap'
|
||||||
|
|
||||||
const GLOBALS_WHITE_LISTED =
|
const GLOBALS_ALLOWED =
|
||||||
'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
|
'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
|
||||||
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
|
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
|
||||||
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console'
|
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console'
|
||||||
|
|
||||||
export const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED)
|
export const isGloballyAllowed = /*#__PURE__*/ makeMap(GLOBALS_ALLOWED)
|
|
@ -3,7 +3,7 @@ export * from './general'
|
||||||
export * from './patchFlags'
|
export * from './patchFlags'
|
||||||
export * from './shapeFlags'
|
export * from './shapeFlags'
|
||||||
export * from './slotFlags'
|
export * from './slotFlags'
|
||||||
export * from './globalsWhitelist'
|
export * from './globalsAllowList'
|
||||||
export * from './codeframe'
|
export * from './codeframe'
|
||||||
export * from './normalizeProp'
|
export * from './normalizeProp'
|
||||||
export * from './domTagConfig'
|
export * from './domTagConfig'
|
||||||
|
|
Loading…
Reference in New Issue