Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions run-test262.c
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,15 @@ int run_test_buf(const char *filename, char *harness, namelist_t *ip,
if (eval_file(ctx, harness, ip->array[i], JS_EVAL_TYPE_GLOBAL)) {
fatal(1, "error including %s for %s", ip->array[i], filename);
}
// hack to get useful stack traces from Test262Error exceptions
if (verbose > 1 && str_equal(ip->array[i], "sta.js")) {
static const char hack[] =
";(function(C){"
"globalThis.Test262Error = class Test262Error extends Error {};"
"globalThis.Test262Error.thrower = C.thrower;"
"})(Test262Error)";
JS_FreeValue(ctx, JS_Eval(ctx, hack, sizeof(hack)-1, "sta.js", JS_EVAL_TYPE_GLOBAL));
}
}

ret = eval_buf(ctx, buf, buf_len, filename, TRUE, is_negative,
Expand Down
Loading