Web-driver support for loose parser + small fixes.

* Added support for acorn_loose and grouped log to web-driver.
* Removed unused copy-pasted `parseTemplate` from loose parser.
* Throw non-SyntaxError errors immediately (as those are generic).
This commit is contained in:
Ingvar Stepanyan
2014-11-03 20:07:19 +02:00
committed by Marijn Haverbeke
parent 6bf8311061
commit 96ccdb05fa
4 changed files with 103 additions and 92 deletions

View File

@@ -52,12 +52,15 @@
else callback("ok", test.code);
}
} catch(e) {
if (test.error && e instanceof SyntaxError) {
if (!(e instanceof SyntaxError)) {
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 instanceof SyntaxError) && e.stack || e.message || e.toString());
callback("error", test.code, e.message || e.toString());
}
}
}