diff --git a/jserror.c b/jserror.c index 50ce982..5fa9c5a 100644 --- a/jserror.c +++ b/jserror.c @@ -61,7 +61,7 @@ static int jsB_ErrorX(js_State *J, js_Object *prototype) js_defproperty(J, -2, "message", JS_DONTENUM); } if (jsB_stacktrace(J, 1)) - js_defproperty(J, -2, "stackTrace", JS_DONTENUM); + js_defproperty(J, -2, "stack", JS_DONTENUM); return 1; } @@ -71,7 +71,7 @@ static void js_newerrorx(js_State *J, const char *message, js_Object *prototype) js_pushstring(J, message); js_setproperty(J, -2, "message"); if (jsB_stacktrace(J, 0)) - js_setproperty(J, -2, "stackTrace"); + js_setproperty(J, -2, "stack"); } #define DERROR(name, Name) \ diff --git a/main.c b/main.c index fb8c986..d7eae8a 100644 --- a/main.c +++ b/main.c @@ -225,7 +225,7 @@ static const char *stacktrace_js = "Error.prototype.toString = function() {\n" "var s = this.name;\n" "if ('message' in this) s += ': ' + this.message;\n" - "if ('stackTrace' in this) s += this.stackTrace;\n" + "if ('stack' in this) s += this.stack;\n" "return s;\n" "};\n" ; diff --git a/tools/test262-harness.js b/tools/test262-harness.js index 1b7eab1..54ae9c4 100644 --- a/tools/test262-harness.js +++ b/tools/test262-harness.js @@ -127,16 +127,16 @@ var msg = !neg_str ? err : "[Mismatch @negative " + neg_str + "]" + "\n " + err; info += (result.runtime ? "[run] " : "[load] ") + msg; - if (err && err.stackTrace && (result.runtime || full_mode)) { + if (err && err.stack && (result.runtime || full_mode)) { if (full_mode) { - info += err.stackTrace; + info += err.stack; } else { // trim the internal loader from the trace - var internal = err.stackTrace.indexOf("\n" + load("mujs_blahblah()").err.stackTrace.trim().split("\n")[1]); + var internal = err.stack.indexOf("\n" + load("mujs_blahblah()").err.stack.trim().split("\n")[1]); if (internal >= 0) - info += err.stackTrace.substring(0, internal); + info += err.stack.substring(0, internal); else - info += err.stackTrace; + info += err.stack; } } } else {