diff --git a/test/driver.js b/test/driver.js index 46e29e547c..ed48ace821 100644 --- a/test/driver.js +++ b/test/driver.js @@ -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; diff --git a/test/run.js b/test/run.js index 865eed5cd3..43dc21d76a 100644 --- a/test/run.js +++ b/test/run.js @@ -51,12 +51,12 @@ var stats, modes = { Normal: { config: { - parse: (typeof require === "undefined" ? window.acorn : require("../dist/acorn")).parse + parse: acorn.parse } }, Loose: { config: { - parse: (typeof require === "undefined" ? window.acorn : require("../dist/acorn_loose")).parse_dammit, + parse: acorn.parse_dammit, loose: true, filter: function (test) { var opts = test.options || {};