mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 17:27:35 +00:00
LibJS: Convert a RegExp throw_exception to throw_completion
RegExpExec already returns a ThrowCompletionOr so this potentional error should be a completion. RegExp.prototype [ @@replace ] is tripped up by this mistake when implemented closer to the spec.
This commit is contained in:
parent
154ed3994c
commit
26294a2d27
1 changed files with 1 additions and 1 deletions
|
@ -257,7 +257,7 @@ ThrowCompletionOr<Value> regexp_exec(GlobalObject& global_object, Object& regexp
|
|||
auto result = TRY(vm.call(exec.as_function(), ®exp_object, js_string(vm, move(string))));
|
||||
|
||||
if (!result.is_object() && !result.is_null())
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::NotAnObjectOrNull, result.to_string_without_side_effects());
|
||||
return vm.throw_completion<TypeError>(global_object, ErrorType::NotAnObjectOrNull, result.to_string_without_side_effects());
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue