@@ -564,9 +564,9 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match)
564
564
// 1. Let O be ? RequireObjectCoercible(this value).
565
565
auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
566
566
567
- // 2. If regexp is neither undefined nor null , then
567
+ // 2. If regexp is an Object , then
568
568
auto regexp = vm.argument (0 );
569
- if (! regexp.is_nullish ()) {
569
+ if (regexp.is_object ()) {
570
570
// a. Let matcher be ? GetMethod(regexp, @@match).
571
571
auto matcher = TRY (regexp.get_method (vm, vm.well_known_symbol_match ()));
572
572
@@ -595,8 +595,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match_all)
595
595
// 1. Let O be ? RequireObjectCoercible(this value).
596
596
auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
597
597
598
- // 2. If regexp is neither undefined nor null , then
599
- if (! regexp.is_nullish ()) {
598
+ // 2. If regexp is an Object , then
599
+ if (regexp.is_object ()) {
600
600
// a. Let isRegExp be ? IsRegExp(regexp).
601
601
auto is_regexp = TRY (regexp.is_regexp (vm));
602
602
@@ -782,8 +782,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::replace)
782
782
// 1. Let O be ? RequireObjectCoercible(this value).
783
783
auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
784
784
785
- // 2. If searchValue is neither undefined nor null , then
786
- if (! search_value.is_nullish ()) {
785
+ // 2. If searchValue is an Object , then
786
+ if (search_value.is_object ()) {
787
787
// a. Let replacer be ? GetMethod(searchValue, @@replace).
788
788
auto replacer = TRY (search_value.get_method (vm, vm.well_known_symbol_replace ()));
789
789
@@ -861,8 +861,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::replace_all)
861
861
// 1. Let O be ? RequireObjectCoercible(this value).
862
862
auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
863
863
864
- // 2. If searchValue is neither undefined nor null , then
865
- if (! search_value.is_nullish ()) {
864
+ // 2. If searchValue is an Object , then
865
+ if (search_value.is_object ()) {
866
866
// a. Let isRegExp be ? IsRegExp(searchValue).
867
867
bool is_regexp = TRY (search_value.is_regexp (vm));
868
868
@@ -977,8 +977,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::search)
977
977
// 1. Let O be ? RequireObjectCoercible(this value).
978
978
auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
979
979
980
- // 2. If regexp is neither undefined nor null , then
981
- if (! regexp.is_nullish ()) {
980
+ // 2. If regexp is an Object , then
981
+ if (regexp.is_object ()) {
982
982
// a. Let searcher be ? GetMethod(regexp, @@search).
983
983
auto searcher = TRY (regexp.get_method (vm, vm.well_known_symbol_search ()));
984
984
@@ -1058,8 +1058,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::split)
1058
1058
// 1. Let O be ? RequireObjectCoercible(this value).
1059
1059
auto object = TRY (require_object_coercible (vm, vm.this_value ()));
1060
1060
1061
- // 2. If separator is neither undefined nor null , then
1062
- if (! separator_argument.is_nullish ()) {
1061
+ // 2. If separator is an Object , then
1062
+ if (separator_argument.is_object ()) {
1063
1063
// a. Let splitter be ? GetMethod(separator, @@split).
1064
1064
auto splitter = TRY (separator_argument.get_method (vm, vm.well_known_symbol_split ()));
1065
1065
// b. If splitter is not undefined, then
0 commit comments