]> git.kaiwu.me - quickjs.git/commitdiff
changed module rejection order according to spec change
authorFabrice Bellard <fabrice@bellard.org>
Sat, 18 Oct 2025 08:50:51 +0000 (10:50 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Sat, 18 Oct 2025 08:50:51 +0000 (10:50 +0200)
quickjs.c
test262_errors.txt

index aff24772afde23cf001d619f1ecde24f81070ac9..4a88e80cbded33e67a5ba8069d5eb2795a3031e6 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -30249,14 +30249,6 @@ static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValueConst t
     module->status = JS_MODULE_STATUS_EVALUATED;
     module->async_evaluation = FALSE;
 
-    for(i = 0; i < module->async_parent_modules_count; i++) {
-        JSModuleDef *m = module->async_parent_modules[i];
-        JSValue m_obj = JS_NewModuleValue(ctx, m);
-        js_async_module_execution_rejected(ctx, JS_UNDEFINED, 1, &error, 0,
-                                           &m_obj);
-        JS_FreeValue(ctx, m_obj);
-    }
-
     if (!JS_IsUndefined(module->promise)) {
         JSValue ret_val;
         assert(module->cycle_root == module);
@@ -30264,6 +30256,14 @@ static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValueConst t
                           1, &error);
         JS_FreeValue(ctx, ret_val);
     }
+
+    for(i = 0; i < module->async_parent_modules_count; i++) {
+        JSModuleDef *m = module->async_parent_modules[i];
+        JSValue m_obj = JS_NewModuleValue(ctx, m);
+        js_async_module_execution_rejected(ctx, JS_UNDEFINED, 1, &error, 0,
+                                           &m_obj);
+        JS_FreeValue(ctx, m_obj);
+    }
     return JS_UNDEFINED;
 }
 
index ec3df0f3e8d47ddb53c22ad16002f4e37cd705e6..7cd4963a0f93d28d2b0be1dc0753754b66574799 100644 (file)
@@ -6,7 +6,6 @@ test262/test/annexB/language/expressions/assignmenttargettype/callexpression-in-
 test262/test/annexB/language/expressions/assignmenttargettype/callexpression.js:33: SyntaxError: invalid assignment left-hand side
 test262/test/annexB/language/expressions/assignmenttargettype/cover-callexpression-and-asyncarrowhead.js:20: SyntaxError: invalid assignment left-hand side
 test262/test/language/identifier-resolution/assign-to-global-undefined.js:20: strict mode: expected error
-test262/test/language/module-code/top-level-await/rejection-order.js:20: TypeError: $DONE() not called
 test262/test/staging/sm/Function/arguments-parameter-shadowing.js:14: Test262Error: Expected SameValue(«true», «false») to be true
 test262/test/staging/sm/Function/constructor-binding.js:11: Test262Error: Expected SameValue(«"function"», «"undefined"») to be true
 test262/test/staging/sm/Function/constructor-binding.js:11: strict mode: Test262Error: Expected SameValue(«"function"», «"undefined"») to be true