LibJS: Remove invalid call to realm() on bytecode generator error

There is no realm when that call happens, use the same logic as the
lines above to create an error from the VM alone.
This commit is contained in:
devgianlu 2025-04-05 19:46:27 +02:00 committed by Andreas Kling
parent 27c19c02d2
commit 6fc9de7aab
Notes: github-actions[bot] 2025-04-05 18:56:14 +00:00

View file

@ -257,7 +257,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record, GC::Ptr<Environ
else if (error_string = String::formatted("TODO({})", error_string.value()); error_string.is_error())
result = vm.template throw_completion<JS::InternalError>(vm.error_message(JS::VM::ErrorMessage::OutOfMemory));
else
result = JS::throw_completion(JS::InternalError::create(realm(), error_string.release_value()));
result = vm.template throw_completion<JS::InternalError>(error_string.release_value());
} else {
auto executable = executable_result.release_value();