puppeteer/third_party/phantomjs/test/basics/stacktrace.js
JoelEinbinder fdaaa2c0e6 Inject file with sourceURL (#102)
This patch starts adding a sourceURL trailing comment to make stack traces
readable.
2017-07-23 09:56:35 -07:00

13 lines
428 B
JavaScript

// A SyntaxError leaks to phantom.onError, despite the try-catch.
setup({ allow_uncaught_exception: true });
test(function () {
var helperFile = "../fixtures/parse-error-helper.js";
try {
phantom.injectJs(helperFile);
assert_is_true(false);
} catch (e) {
assert_is_true(e.stack.indexOf('fixtures/parse-error-helper.js:2') !== -1);
}
}, "stack trace from syntax error in injected file");