Skip to content

Commit

Permalink
perf: always return void 0 as undefined node
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jul 19, 2019
1 parent a0cb7b1 commit ca44286
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/babel-traverse/src/scope/index.js
Expand Up @@ -490,12 +490,7 @@ export default class Scope {
}

buildUndefinedNode() {
if (this.hasBinding("undefined")) {
return t.unaryExpression("void", t.numericLiteral(0), true);
} else {
// eslint-disable-next-line @babel/development/no-undefined-identifier
return t.identifier("undefined");
}
return t.unaryExpression("void", t.numericLiteral(0), true);
}

registerConstantViolation(path: NodePath) {
Expand Down

0 comments on commit ca44286

Please sign in to comment.