Skip to content

Commit e93f441

Browse files
caztanjgmta
authored andcommitted
LibJS: Do not verify cycle root's status is linked in CyclicModule
This VERIFY is both incorrect and redundant. The VERIFY at step 2 verifies the status when evaluate is called on m_cycle_root.
1 parent 61c36e2 commit e93f441

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

Libraries/LibJS/CyclicModule.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ ThrowCompletionOr<GC::Ref<Promise>> CyclicModule::evaluate(VM& vm)
344344
if ((m_status == ModuleStatus::EvaluatingAsync || m_status == ModuleStatus::Evaluated) && m_cycle_root != this) {
345345
// Note: This will continue this function with module.[[CycleRoot]]
346346
VERIFY(m_cycle_root);
347-
VERIFY(m_cycle_root->m_status == ModuleStatus::Linked);
348347
dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] evaluate[{}](vm) deferring to cycle root at {}", this, m_cycle_root.ptr());
349348
return m_cycle_root->evaluate(vm);
350349
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { foo } from "./cyclic-async-module-b.mjs";
2+
3+
await new Promise(resolve => setTimeout(resolve, 200));
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import "./cyclic-async-module-a.mjs";
2+
3+
export const foo = "value from B";
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!DOCTYPE html>
2+
<script src="./cyclic-async-module.mjs"></script>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(async function () {
2+
const first = import("./cyclic-async-module-a.mjs");
3+
const second = import("./cyclic-async-module-b.mjs");
4+
5+
await first;
6+
await second;
7+
})();

0 commit comments

Comments
 (0)