mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:15:06 +00:00
LibJS: Convert get_this_binding() to ThrowCompletionOr
Also add spec step comments to it while we're here.
This commit is contained in:
parent
4f03138971
commit
0aa24f4ce5
8 changed files with 21 additions and 16 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue