mirror of
https://github.com/zulip/zulip.git
synced 2026-07-12 21:04:41 +08:00
This was "npm update handlebars" followed by copying runtime.js into the static directory and restoring the copyright header. (imported from commit 69d30cbfcb3b776cdfdcffa17a87704540eab76a)
28 lines
687 B
JavaScript
28 lines
687 B
JavaScript
|
|
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
|
|
|
|
function Exception(message, node) {
|
|
var line;
|
|
if (node && node.firstLine) {
|
|
line = node.firstLine;
|
|
|
|
message += ' - ' + line + ':' + node.firstColumn;
|
|
}
|
|
|
|
var tmp = Error.prototype.constructor.call(this, message);
|
|
|
|
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
|
|
for (var idx = 0; idx < errorProps.length; idx++) {
|
|
this[errorProps[idx]] = tmp[errorProps[idx]];
|
|
}
|
|
|
|
if (line) {
|
|
this.lineNumber = line;
|
|
this.column = node.firstColumn;
|
|
}
|
|
}
|
|
|
|
Exception.prototype = new Error();
|
|
|
|
export default Exception;
|