mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
LibJS: Update CyclicModule to match current spec
Just some minor comment tweaks and an updated assertion.
This commit is contained in:
parent
7970f45953
commit
d7005be768
1 changed files with 5 additions and 6 deletions
|
@ -165,13 +165,12 @@ void continue_module_loading(GraphLoadingState& state, ThrowCompletionOr<Nonnull
|
|||
// 4. Return UNUSED.
|
||||
}
|
||||
|
||||
// 16.2.1.5.1 Link ( ), https://tc39.es/ecma262/#sec-moduledeclarationlinking
|
||||
// 16.2.1.5.2 Link ( ), https://tc39.es/ecma262/#sec-moduledeclarationlinking
|
||||
ThrowCompletionOr<void> CyclicModule::link(VM& vm)
|
||||
{
|
||||
dbgln_if(JS_MODULE_DEBUG, "[JS MODULE] link[{}]()", this);
|
||||
// 1. Assert: module.[[Status]] is not linking or evaluating.
|
||||
VERIFY(m_status != ModuleStatus::Linking);
|
||||
VERIFY(m_status != ModuleStatus::Evaluating);
|
||||
// 1. Assert: module.[[Status]] is one of unlinked, linked, evaluating-async, or evaluated.
|
||||
VERIFY(m_status == ModuleStatus::Unlinked || m_status == ModuleStatus::Linked || m_status == ModuleStatus::EvaluatingAsync || m_status == ModuleStatus::Evaluated);
|
||||
// 2. Let stack be a new empty List.
|
||||
Vector<Module*> stack;
|
||||
|
||||
|
@ -194,11 +193,11 @@ ThrowCompletionOr<void> CyclicModule::link(VM& vm)
|
|||
// b. Assert: module.[[Status]] is unlinked.
|
||||
VERIFY(m_status == ModuleStatus::Unlinked);
|
||||
|
||||
// c. Return result.
|
||||
// c. Return ? result.
|
||||
return result.release_error();
|
||||
}
|
||||
|
||||
// 5. Assert: module.[[Status]] is linked, evaluating-async, or evaluated.
|
||||
// 5. Assert: module.[[Status]] is one of linked, evaluating-async, or evaluated.
|
||||
VERIFY(m_status == ModuleStatus::Linked || m_status == ModuleStatus::EvaluatingAsync || m_status == ModuleStatus::Evaluated);
|
||||
// 6. Assert: stack is empty.
|
||||
VERIFY(stack.is_empty());
|
||||
|
|
Loading…
Add table
Reference in a new issue