Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

temporary mitigation of bug 551604 #528

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/api-utils/lib/loader.js
Expand Up @@ -163,8 +163,14 @@ const evaluate = iced(function evaluate(sandbox, uri, options) {
source: null
}, options);

return source ? Cu.evalInSandbox(source, sandbox, version, uri, line)
: loadSubScript(uri, sandbox, encoding);
try {
return source ? Cu.evalInSandbox(source, sandbox, version, uri, line)
: loadSubScript(uri, sandbox, encoding);
} catch (exc if exc.name === "SyntaxError") {
// see https://bugzilla.mozilla.org/show_bug.cgi?id=551604
throw SyntaxError(exc.message+' at '+exc.fileName+':'+exc.lineNumber,
exc.fileName, exc.lineNumber);
}
});
exports.evaluate = evaluate;

Expand Down