chore: update reference to transformExpressions (#2682) [ci skip]

This commit is contained in:
Damon Muma 2022-05-09 21:30:50 -04:00 committed by GitHub
parent 7d7a2410e5
commit 0abcb2b80d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -330,7 +330,7 @@ function stringifyElement(
// here, e.g. `{{ 1 }}` or `{{ 'foo' }}` // here, e.g. `{{ 1 }}` or `{{ 'foo' }}`
// in addition, constant exps bail on presence of parens so you can't even // in addition, constant exps bail on presence of parens so you can't even
// run JSFuck in here. But we mark it unsafe for security review purposes. // run JSFuck in here. But we mark it unsafe for security review purposes.
// (see compiler-core/src/transformExpressions) // (see compiler-core/src/transforms/transformExpression)
function evaluateConstant(exp: ExpressionNode): string { function evaluateConstant(exp: ExpressionNode): string {
if (exp.type === NodeTypes.SIMPLE_EXPRESSION) { if (exp.type === NodeTypes.SIMPLE_EXPRESSION) {
return new Function(`return ${exp.content}`)() return new Function(`return ${exp.content}`)()