mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibJS: Convert resolve_this_binding() to ThrowCompletionOr
Also add spec comments.
This commit is contained in:
parent
dc03529ffd
commit
a24df37713
Notes:
sideshowbarker
2024-07-17 21:53:17 +09:00
Author: https://github.com/davidot
Commit: a24df37713
Pull-request: https://github.com/SerenityOS/serenity/pull/11514
Reviewed-by: https://github.com/linusg ✅
4 changed files with 13 additions and 5 deletions
|
@ -503,10 +503,12 @@ void VM::throw_exception(Exception& exception)
|
|||
}
|
||||
|
||||
// 9.4.4 ResolveThisBinding ( ), https://tc39.es/ecma262/#sec-resolvethisbinding
|
||||
Value VM::resolve_this_binding(GlobalObject& global_object)
|
||||
ThrowCompletionOr<Value> VM::resolve_this_binding(GlobalObject& global_object)
|
||||
{
|
||||
// 1. Let envRec be GetThisEnvironment().
|
||||
auto& environment = get_this_environment(*this);
|
||||
return TRY_OR_DISCARD(environment.get_this_binding(global_object));
|
||||
// 2. Return ? envRec.GetThisBinding().
|
||||
return TRY(environment.get_this_binding(global_object));
|
||||
}
|
||||
|
||||
String VM::join_arguments(size_t start_index) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue