mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibJS: Remove implicit wrapping/unwrapping of completion records
This is an editorial change in the ECMA-262 spec, with similar changes in some proposals. See: -7575f74
-df899eb
-9eb5a12
-c81f527
This commit is contained in:
parent
15f32379bb
commit
9f3f3b0864
Notes:
sideshowbarker
2024-07-17 11:22:30 +09:00
Author: https://github.com/linusg
Commit: 9f3f3b0864
Pull-request: https://github.com/SerenityOS/serenity/pull/13887
Reviewed-by: https://github.com/IdanHo ✅
88 changed files with 792 additions and 735 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2020-2021, Linus Groh <linusg@serenityos.org>
|
||||
* Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
|
||||
* Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
|
@ -80,7 +80,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record)
|
|||
// 11. Let script be scriptRecord.[[ECMAScriptCode]].
|
||||
auto& script = script_record.parse_node();
|
||||
|
||||
// 12. Let result be GlobalDeclarationInstantiation(script, globalEnv).
|
||||
// 12. Let result be Completion(GlobalDeclarationInstantiation(script, globalEnv)).
|
||||
auto instantiation_result = script.global_declaration_instantiation(*this, global_object, global_environment);
|
||||
Completion result = instantiation_result.is_throw_completion() ? instantiation_result.throw_completion() : normal_completion({});
|
||||
|
||||
|
@ -116,7 +116,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record)
|
|||
|
||||
vm.finish_execution_generation();
|
||||
|
||||
// 18. Return Completion(result).
|
||||
// 18. Return ? result.
|
||||
if (result.is_abrupt()) {
|
||||
VERIFY(result.type() == Completion::Type::Throw);
|
||||
return result.release_error();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue