|
@@ -729,9 +729,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match)
|
|
|
|
|
|
auto string = TRY(this_object.to_utf16_string(global_object));
|
|
auto string = TRY(this_object.to_utf16_string(global_object));
|
|
|
|
|
|
- auto* rx = regexp_create(global_object, regexp, js_undefined());
|
|
|
|
- if (auto* exception = vm.exception())
|
|
|
|
- return throw_completion(exception->value());
|
|
|
|
|
|
+ auto* rx = TRY(regexp_create(global_object, regexp, js_undefined()));
|
|
return TRY(Value(rx).invoke(global_object, *vm.well_known_symbol_match(), js_string(vm, move(string))));
|
|
return TRY(Value(rx).invoke(global_object, *vm.well_known_symbol_match(), js_string(vm, move(string))));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -755,9 +753,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match_all)
|
|
|
|
|
|
auto string = TRY(this_object.to_utf16_string(global_object));
|
|
auto string = TRY(this_object.to_utf16_string(global_object));
|
|
|
|
|
|
- auto* rx = regexp_create(global_object, regexp, js_string(vm, "g"));
|
|
|
|
- if (auto* exception = vm.exception())
|
|
|
|
- return throw_completion(exception->value());
|
|
|
|
|
|
+ auto* rx = TRY(regexp_create(global_object, regexp, js_string(vm, "g")));
|
|
return TRY(Value(rx).invoke(global_object, *vm.well_known_symbol_match_all(), js_string(vm, move(string))));
|
|
return TRY(Value(rx).invoke(global_object, *vm.well_known_symbol_match_all(), js_string(vm, move(string))));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -884,9 +880,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::search)
|
|
|
|
|
|
auto string = TRY(this_object.to_utf16_string(global_object));
|
|
auto string = TRY(this_object.to_utf16_string(global_object));
|
|
|
|
|
|
- auto* rx = regexp_create(global_object, regexp, js_undefined());
|
|
|
|
- if (auto* exception = vm.exception())
|
|
|
|
- return throw_completion(exception->value());
|
|
|
|
|
|
+ auto* rx = TRY(regexp_create(global_object, regexp, js_undefined()));
|
|
return TRY(Value(rx).invoke(global_object, *vm.well_known_symbol_search(), js_string(vm, move(string))));
|
|
return TRY(Value(rx).invoke(global_object, *vm.well_known_symbol_search(), js_string(vm, move(string))));
|
|
}
|
|
}
|
|
|
|
|