if (win.NS && win.NS.molist && win.NS.molist.utility) {
NS = win.NS;
NS.molist.dom = true;
} else {
throw "dom requires utility module";
}
For the snippet above, what is the proper way to throw an error, if win.NS.molist.utility
does not exist?
Can I just throw up the text I want displayed to be shown in the debugger?
Perhaps, I should use one of the built in error types?
Maybe a new TypeError
, I'm not sure as there are many global Errors objects.