Use uniform object type for node types

Speeds things up by about 9% on io.js 1.3
This commit is contained in:
Marijn Haverbeke 2015-02-23 23:22:45 +01:00
parent 141905f9fd
commit 6bd1013f2c
2 changed files with 341 additions and 325 deletions

662
acorn.js

File diff suppressed because it is too large Load Diff

View File

@ -627,7 +627,7 @@
function parseMaybeUnary(noIn) {
if (token.type.prefix) {
var node = startNode(), update = token.type.isUpdate;
var node = startNode(), update = token.type === tt.incDec;
node.operator = token.value;
node.prefix = true;
next();
@ -733,7 +733,7 @@
case tt._null: case tt._true: case tt._false:
var node = startNode();
node.value = token.type.atomValue;
node.value = token.type === tt._null ? null : token.type === tt._true;
node.raw = token.type.keyword;
next();
return finishNode(node, "Literal");