mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
LibJS: Convert get_this_binding() to ThrowCompletionOr
Also add spec step comments to it while we're here.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 02:52:43 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/0aa24f4ce5e Pull-request: https://github.com/SerenityOS/serenity/pull/10413 Reviewed-by: https://github.com/IdanHo ✅
@@ -256,9 +256,7 @@ ThrowCompletionOr<Object*> ECMAScriptFunctionObject::internal_construct(MarkedVa
|
||||
}
|
||||
|
||||
// 12. Return ? constructorEnv.GetThisBinding().
|
||||
auto this_binding = constructor_env->get_this_binding(global_object);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto this_binding = TRY(constructor_env->get_this_binding(global_object));
|
||||
return &this_binding.as_object();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user