mirror of https://github.com/vuejs/core.git
chore: fix mishandled regex const check
This commit is contained in:
parent
4121de4960
commit
d48706336a
|
@ -544,7 +544,6 @@ export function isStaticNode(node: Node): boolean {
|
||||||
case 'BooleanLiteral':
|
case 'BooleanLiteral':
|
||||||
case 'NullLiteral':
|
case 'NullLiteral':
|
||||||
case 'BigIntLiteral':
|
case 'BigIntLiteral':
|
||||||
case 'RegExpLiteral':
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
@ -558,6 +557,8 @@ export function isConstantNode(node: Node, bindings: BindingMetadata): boolean {
|
||||||
case 'Identifier':
|
case 'Identifier':
|
||||||
const type = bindings[node.name]
|
const type = bindings[node.name]
|
||||||
return type === BindingTypes.LITERAL_CONST
|
return type === BindingTypes.LITERAL_CONST
|
||||||
|
case 'RegExpLiteral':
|
||||||
|
return true
|
||||||
case 'ObjectExpression':
|
case 'ObjectExpression':
|
||||||
return node.properties.every(prop => {
|
return node.properties.every(prop => {
|
||||||
// { bar() {} } object methods are not considered static nodes
|
// { bar() {} } object methods are not considered static nodes
|
||||||
|
|
Loading…
Reference in New Issue