Merge acorn 1.0.0 (formerly 'update to modular acorn' in original history).

This commit is contained in:
Logan Smyth
2016-03-14 22:45:27 -07:00
35 changed files with 4541 additions and 46810 deletions

7
test/driver.js Normal file → Executable file
View File

@@ -27,13 +27,13 @@
try {
var ast = parse(test.code, testOpts);
} catch(e) {
if (!(e instanceof SyntaxError)) throw e;
if (!(e instanceof SyntaxError)) { console.log(e.stack); throw e; }
if (test.error) {
if (e.message == test.error) callback("ok", test.code);
else callback("fail", test.code,
"Expected error message: " + test.error + "\nGot error message: " + e.message);
} else {
callback("error", test.code, e.stack || e.toString());
callback("error", test.code, e.message || e.toString());
}
continue
}
@@ -69,7 +69,8 @@
var misMatch = exports.misMatch = function(exp, act) {
if (!exp || !act || (typeof exp != "object") || (typeof act != "object")) {
if (exp !== act) return ppJSON(exp) + " !== " + ppJSON(act);
if (exp !== act && typeof exp != "function")
return ppJSON(exp) + " !== " + ppJSON(act);
} else if (exp instanceof RegExp || act instanceof RegExp) {
var left = ppJSON(exp), right = ppJSON(act);
if (left !== right) return left + " !== " + right;