diff options
author | Timothy Flynn <trflynn89@pm.me> | 2021-12-17 14:42:24 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-12-21 14:56:00 +0100 |
commit | 26294a2d273f1a65e328b5186e8d6f7fc550b59a (patch) | |
tree | afc0aef1b4c4f79919719026facf0b77ad9146c0 /Userland/Libraries | |
parent | 154ed3994c874c2d7bd15fd6b10e94a659e3d8ef (diff) | |
download | serenity-26294a2d273f1a65e328b5186e8d6f7fc550b59a.zip |
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.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 4b091e585e..c5bf50f21b 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -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; } |