Skip to content

Commit a95e612

Browse files
committed
chore: rename globals allow list
close #8416
1 parent 020851e commit a95e612

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

packages/compiler-core/src/transforms/transformExpression.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
} from '../babelUtils'
2626
import { advancePositionWithClone, isSimpleIdentifier } from '../utils'
2727
import {
28-
isGloballyWhitelisted,
28+
isGloballyAllowed,
2929
makeMap,
3030
hasOwn,
3131
isString,
@@ -225,7 +225,7 @@ export function processExpression(
225225

226226
if (isSimpleIdentifier(rawExp)) {
227227
const isScopeVarReference = context.identifiers[rawExp]
228-
const isAllowedGlobal = isGloballyWhitelisted(rawExp)
228+
const isAllowedGlobal = isGloballyAllowed(rawExp)
229229
const isLiteral = isLiteralWhitelisted(rawExp)
230230
if (!asParams && !isScopeVarReference && !isAllowedGlobal && !isLiteral) {
231231
// const bindings exposed from setup can be skipped for patching but
@@ -358,7 +358,7 @@ export function processExpression(
358358

359359
function canPrefix(id: Identifier) {
360360
// skip whitelisted globals
361-
if (isGloballyWhitelisted(id.name)) {
361+
if (isGloballyAllowed(id.name)) {
362362
return false
363363
}
364364
// special case for webpack compilation

packages/runtime-core/src/componentPublicInstance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { instanceWatch, WatchOptions, WatchStopHandle } from './apiWatch'
99
import {
1010
EMPTY_OBJ,
1111
hasOwn,
12-
isGloballyWhitelisted,
12+
isGloballyAllowed,
1313
NOOP,
1414
extend,
1515
isString,
@@ -511,7 +511,7 @@ export const RuntimeCompiledPublicInstanceProxyHandlers = /*#__PURE__*/ extend(
511511
return PublicInstanceProxyHandlers.get!(target, key, target)
512512
},
513513
has(_: ComponentRenderContext, key: string) {
514-
const has = key[0] !== '_' && !isGloballyWhitelisted(key)
514+
const has = key[0] !== '_' && !isGloballyAllowed(key)
515515
if (__DEV__ && !has && PublicInstanceProxyHandlers.has!(_, key)) {
516516
warn(
517517
`Property ${JSON.stringify(
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { makeMap } from './makeMap'
22

3-
const GLOBALS_WHITE_LISTED =
3+
const GLOBALS_ALLOWED =
44
'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,' +
55
'decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,' +
66
'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console'
77

8-
export const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED)
8+
export const isGloballyAllowed = /*#__PURE__*/ makeMap(GLOBALS_ALLOWED)

packages/shared/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export * from './general'
33
export * from './patchFlags'
44
export * from './shapeFlags'
55
export * from './slotFlags'
6-
export * from './globalsWhitelist'
6+
export * from './globalsAllowList'
77
export * from './codeframe'
88
export * from './normalizeProp'
99
export * from './domTagConfig'

0 commit comments

Comments
 (0)