INNER CODE UNIT · JavaScript
exit
gnh1201/welsonjs · app.js:34
var exit = function(status) {
console.error("Exit", status, "caused");
if (typeof WScript !== "undefined") {
WScript.Quit(status);
return;
} else if (typeof window !== "undefined") {
window.close();
return;
}
// to exit completely
throw new Error("Exit " + status + " caused");
};
/**
* @param {Function} f The function to execute.
* @param {any} defaultValue The default value to return if the function throws an error.