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 'NullLiteral':
|
||||
case 'BigIntLiteral':
|
||||
case 'RegExpLiteral':
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
@ -558,6 +557,8 @@ export function isConstantNode(node: Node, bindings: BindingMetadata): boolean {
|
|||
case 'Identifier':
|
||||
const type = bindings[node.name]
|
||||
return type === BindingTypes.LITERAL_CONST
|
||||
case 'RegExpLiteral':
|
||||
return true
|
||||
case 'ObjectExpression':
|
||||
return node.properties.every(prop => {
|
||||
// { bar() {} } object methods are not considered static nodes
|
||||
|
|
Loading…
Reference in New Issue