1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

LibJS: Convert get_this_environment() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-15 20:07:13 +00:00 committed by Andreas Kling
parent c132064ee9
commit e785c66f91
5 changed files with 16 additions and 16 deletions

View file

@ -513,7 +513,7 @@ Completion SuperCall::execute(Interpreter& interpreter) const
auto result = TRY(construct(vm, static_cast<FunctionObject&>(*func), move(arg_list), &new_target.as_function()));
// 7. Let thisER be GetThisEnvironment().
auto& this_er = verify_cast<FunctionEnvironment>(get_this_environment(vm));
auto& this_er = verify_cast<FunctionEnvironment>(*get_this_environment(vm));
// 8. Perform ? thisER.BindThisValue(result).
TRY(this_er.bind_this_value(vm, result));
@ -1430,10 +1430,10 @@ ThrowCompletionOr<Reference> MemberExpression::to_reference(Interpreter& interpr
// https://tc39.es/ecma262/#sec-super-keyword-runtime-semantics-evaluation
if (is<SuperExpression>(object())) {
// 1. Let env be GetThisEnvironment().
auto& environment = get_this_environment(vm);
auto environment = get_this_environment(vm);
// 2. Let actualThis be ? env.GetThisBinding().
auto actual_this = TRY(environment.get_this_binding(vm));
auto actual_this = TRY(environment->get_this_binding(vm));
PropertyKey property_key;