From 999da617c5a59f2c8bc8b199c69014ee04668ee1 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 20 Aug 2022 09:48:43 +0100 Subject: LibJS: Remove GlobalObject from VM::this_value() This is a continuation of the previous six commits. The global object is only needed to return it if the execution context stack is empty, but that doesn't seem like a useful thing to allow in the first place - if you're not currently executing JS, and the execution context stack is empty, there is no this value to retrieve. --- Userland/Libraries/LibJS/Bytecode/Op.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibJS/Bytecode') diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp index b2391a9143..ab3a389cb0 100644 --- a/Userland/Libraries/LibJS/Bytecode/Op.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp @@ -697,7 +697,7 @@ ThrowCompletionOr GetObjectPropertyIterator::execute_impl(Bytecode::Interp interpreter.realm(), [seen_items = HashTable(), items = move(properties)](VM& vm, GlobalObject& global_object) mutable -> ThrowCompletionOr { auto& realm = *global_object.associated_realm(); - auto iterated_object_value = vm.this_value(global_object); + auto iterated_object_value = vm.this_value(); if (!iterated_object_value.is_object()) return vm.throw_completion("Invalid state for GetObjectPropertyIterator.next"); -- cgit v1.2.3