perf: always return void 0 as undefined node (#10243)
This commit is contained in:
parent
3e4a9d588b
commit
5fb4d84a33
@ -490,12 +490,7 @@ export default class Scope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
buildUndefinedNode() {
|
buildUndefinedNode() {
|
||||||
if (this.hasBinding("undefined")) {
|
return t.unaryExpression("void", t.numericLiteral(0), true);
|
||||||
return t.unaryExpression("void", t.numericLiteral(0), true);
|
|
||||||
} else {
|
|
||||||
// eslint-disable-next-line @babel/development/no-undefined-identifier
|
|
||||||
return t.identifier("undefined");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
registerConstantViolation(path: NodePath) {
|
registerConstantViolation(path: NodePath) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user