Merge e0e72209f0 into 37d7cb8565
This commit is contained in:
commit
8206f7a860
|
|
@ -178,16 +178,15 @@ function parse_js_number(num) {
|
|||
};
|
||||
|
||||
function JS_Parse_Error(message, line, col, pos) {
|
||||
this.message = message;
|
||||
this.message = message + " (line: " + line + ", col: " + col + ", pos: " + pos + ")";
|
||||
this.line = line;
|
||||
this.col = col;
|
||||
this.pos = pos;
|
||||
this.stack = new Error().stack;
|
||||
// The second parameter omits the JS_Parse_Error constructor from the captured stack trace:
|
||||
Error.captureStackTrace(this, JS_Parse_Error);
|
||||
};
|
||||
|
||||
JS_Parse_Error.prototype.toString = function() {
|
||||
return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack;
|
||||
};
|
||||
JS_Parse_Error.prototype = Error.prototype;
|
||||
|
||||
function js_error(message, filename, line, col, pos) {
|
||||
throw new JS_Parse_Error(message, line, col, pos);
|
||||
|
|
|
|||
|
|
@ -81,11 +81,15 @@ function repeat_string(str, i) {
|
|||
return d;
|
||||
};
|
||||
|
||||
function DefaultsError(msg, defs) {
|
||||
this.msg = msg;
|
||||
function DefaultsError(message, defs) {
|
||||
this.message = message + "(defs: " + JSON.stringify(defs) + ")";
|
||||
this.defs = defs;
|
||||
// The second parameter omits the DefaultError constructor from the captured stack trace:
|
||||
Error.captureStackTrace(this, DefaultsError);
|
||||
};
|
||||
|
||||
DefaultsError.prototype = Error.prototype;
|
||||
|
||||
function defaults(args, defs, croak) {
|
||||
if (args === true)
|
||||
args = {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user