mirror of https://github.com/vuejs/core.git
refactor(compiler): export isLiteralWhitelisted
This commit is contained in:
parent
35b78920c4
commit
0cdc9f20c6
|
@ -54,6 +54,7 @@ export {
|
|||
transformExpression,
|
||||
processExpression,
|
||||
stringifyExpression,
|
||||
isLiteralWhitelisted,
|
||||
} from './transforms/transformExpression'
|
||||
export {
|
||||
buildSlots,
|
||||
|
|
|
@ -44,7 +44,9 @@ import { parse } from '@babel/parser'
|
|||
import { IS_REF, UNREF } from '../runtimeHelpers'
|
||||
import { BindingTypes } from '../options'
|
||||
|
||||
const isLiteralWhitelisted = /*#__PURE__*/ makeMap('true,false,null,this')
|
||||
export const isLiteralWhitelisted = /*#__PURE__*/ makeMap(
|
||||
'true,false,null,this',
|
||||
)
|
||||
|
||||
// a heuristic safeguard to bail constant expressions on presence of
|
||||
// likely function invocation and member access
|
||||
|
|
|
@ -5,10 +5,11 @@ import {
|
|||
type SourceLocation,
|
||||
advancePositionWithClone,
|
||||
isInDestructureAssignment,
|
||||
isLiteralWhitelisted,
|
||||
isStaticProperty,
|
||||
walkIdentifiers,
|
||||
} from '@vue/compiler-dom'
|
||||
import { isGloballyAllowed, makeMap } from '@vue/shared'
|
||||
import { isGloballyAllowed } from '@vue/shared'
|
||||
import type { Identifier } from '@babel/types'
|
||||
import {
|
||||
type CodeFragment,
|
||||
|
@ -98,8 +99,6 @@ export function genExpression(
|
|||
}
|
||||
}
|
||||
|
||||
const isLiteralWhitelisted = /*#__PURE__*/ makeMap('true,false,null,this')
|
||||
|
||||
function genIdentifier(
|
||||
raw: string,
|
||||
{ options, vaporHelper, identifiers }: CodegenContext,
|
||||
|
|
Loading…
Reference in New Issue