Files
firefox/devtools/shared/tests/unit/throwing-module-2.js
T
Alexandre Poirot 5647e40cff Bug 1513028 - Throw exception with stack and message when a module doesn't exists. r=jdescottes
loadSubScript throws a string, without any stack/location.
Consider all string exceptions as coming from loadSubScript and re-throw a real error
object, coming with the stack of the require call.
Also handle wrong require path with a more explicit error message.

Differential Revision: https://phabricator.services.mozilla.com/D14139
2018-12-18 13:35:42 +00:00

9 lines
135 B
JavaScript

"use strict";
function throwingMethod() {
// eslint-disable-next-line no-throw-literal
throw "my-exception";
}
throwingMethod();