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
parent 08cfd5ff1b
commit 7c8554fb95

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();