mirror of
https://github.com/bellard/quickjs.git
synced 2024-11-22 13:48:11 +08:00
fixed run_test262_harness_test() with modules
This commit is contained in:
parent
df3781d082
commit
3c2cfabfc7
@ -1853,8 +1853,13 @@ int run_test262_harness_test(const char *filename, BOOL is_module)
|
||||
if (JS_IsException(res_val)) {
|
||||
js_std_dump_error(ctx);
|
||||
ret_code = 1;
|
||||
} else {
|
||||
JSValue promise = JS_UNDEFINED;
|
||||
if (is_module) {
|
||||
promise = res_val;
|
||||
} else {
|
||||
JS_FreeValue(ctx, res_val);
|
||||
}
|
||||
for(;;) {
|
||||
JSContext *ctx1;
|
||||
ret = JS_ExecutePendingJob(JS_GetRuntime(ctx), &ctx1);
|
||||
@ -1865,6 +1870,16 @@ int run_test262_harness_test(const char *filename, BOOL is_module)
|
||||
break;
|
||||
}
|
||||
}
|
||||
/* dump the error if the module returned an error. */
|
||||
if (is_module) {
|
||||
JSPromiseStateEnum state = JS_PromiseState(ctx, promise);
|
||||
if (state == JS_PROMISE_REJECTED) {
|
||||
JS_Throw(ctx, JS_PromiseResult(ctx, promise));
|
||||
js_std_dump_error(ctx);
|
||||
ret_code = 1;
|
||||
}
|
||||
}
|
||||
JS_FreeValue(ctx, promise);
|
||||
}
|
||||
free(buf);
|
||||
#ifdef CONFIG_AGENT
|
||||
|
Loading…
Reference in New Issue
Block a user