LibJS: Move additional notes to spec comments onto their own line

Having all spec comments verbatim on their own line with no additions
made by us will make it easier to automate comparing said comments to
their current spec counterparts.
This commit is contained in:
Linus Groh 2022-04-11 21:32:37 +01:00
parent 90f14de1e9
commit 24d772af7c
5 changed files with 14 additions and 7 deletions

View file

@ -473,7 +473,8 @@ Completion SuperCall::execute(Interpreter& interpreter, GlobalObject& global_obj
TRY(this_er.bind_this_value(global_object, result));
// 9. Let F be thisER.[[FunctionObject]].
// 10. Assert: F is an ECMAScript function object. (NOTE: This is implied by the strong C++ type.)
// 10. Assert: F is an ECMAScript function object.
// NOTE: This is implied by the strong C++ type.
[[maybe_unused]] auto& f = this_er.function_object();
// 11. Perform ? InitializeInstanceElements(result, F).

View file

@ -52,7 +52,8 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record)
// 2. Let scriptContext be a new ECMAScript code execution context.
ExecutionContext script_context(vm.heap());
// 3. Set the Function of scriptContext to null. (This was done in the construction of script_context)
// 3. Set the Function of scriptContext to null.
// NOTE: This was done during execution context construction.
// 4. Set the Realm of scriptContext to scriptRecord.[[Realm]].
script_context.realm = &script_record.realm();

View file

@ -50,12 +50,14 @@ public:
// 2. Let newContext be a new execution context.
auto& new_context = interpreter->m_global_execution_context;
// 3. Set the Function of newContext to null. (This is done for us when the execution context is constructed)
// 3. Set the Function of newContext to null.
// NOTE: This was done during execution context construction.
// 4. Set the Realm of newContext to realm.
new_context.realm = realm;
// 5. Set the ScriptOrModule of newContext to null. (This was done during execution context construction)
// 5. Set the ScriptOrModule of newContext to null.
// NOTE: This was done during execution context construction.
// 6. Push newContext onto the execution context stack; newContext is now the running execution context.
vm.push_execution_context(new_context);

View file

@ -627,7 +627,8 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::prepare_for_ordinary_call(Exec
TRY(vm.push_execution_context(callee_context, global_object()));
// 13. NOTE: Any exception objects produced after this point are associated with calleeRealm.
// 14. Return calleeContext. (See NOTE above about how contexts are allocated on the C++ stack.)
// 14. Return calleeContext.
// NOTE: See the comment after step 2 above about how contexts are allocated on the C++ stack.
return {};
}

View file

@ -50,10 +50,12 @@ ThrowCompletionOr<Object*> FinalizationRegistryConstructor::construct(FunctionOb
return vm.throw_completion<TypeError>(global_object, ErrorType::NotAFunction, cleanup_callback.to_string_without_side_effects());
// 3. Let finalizationRegistry be ? OrdinaryCreateFromConstructor(NewTarget, "%FinalizationRegistry.prototype%", « [[Realm]], [[CleanupCallback]], [[Cells]] »).
// 4. Let fn be the active function object. (NOTE: Not necessary. The active function object is `this`)
// 4. Let fn be the active function object.
// NOTE: This is not necessary, the active function object is `this`.
// 5. Set finalizationRegistry.[[Realm]] to fn.[[Realm]].
// 6. Set finalizationRegistry.[[CleanupCallback]] to HostMakeJobCallback(cleanupCallback).
// 7. Set finalizationRegistry.[[Cells]] to a new empty List. (NOTE: This is done inside FinalizationRegistry instead of here)
// 7. Set finalizationRegistry.[[Cells]] to a new empty List.
// NOTE: This is done inside FinalizationRegistry instead of here.
// 8. Return finalizationRegistry.
return TRY(ordinary_create_from_constructor<FinalizationRegistry>(global_object, new_target, &GlobalObject::finalization_registry_prototype, *realm(), vm.host_make_job_callback(cleanup_callback.as_function())));
}