Move the parser state into an object
Makes almost everything in acorn.js a method of this object. Performance is not significantly affected on a modern V8. Makes the code reentrant and allows us to more easily expose more methods externally in the future. On the other hand, the proliferation of `this.` is unfortunate.
This commit is contained in:
parent
33307e789a
commit
bc48c02a18
@ -33,8 +33,7 @@
|
||||
} else {
|
||||
callback("fail", test.code, "Expected error message: " + test.error + "\nBut parsing succeeded.");
|
||||
}
|
||||
}
|
||||
else if (test.assert) {
|
||||
} else if (test.assert) {
|
||||
var error = test.assert(ast);
|
||||
if (error) callback("fail", test.code,
|
||||
"\n Assertion failed:\n " + error);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user