@@ -564,9 +564,9 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match)
564564 // 1. Let O be ? RequireObjectCoercible(this value).
565565 auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
566566
567- // 2. If regexp is neither undefined nor null , then
567+ // 2. If regexp is an Object , then
568568 auto regexp = vm.argument (0 );
569- if (! regexp.is_nullish ()) {
569+ if (regexp.is_object ()) {
570570 // a. Let matcher be ? GetMethod(regexp, @@match).
571571 auto matcher = TRY (regexp.get_method (vm, vm.well_known_symbol_match ()));
572572
@@ -595,8 +595,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match_all)
595595 // 1. Let O be ? RequireObjectCoercible(this value).
596596 auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
597597
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 ()) {
600600 // a. Let isRegExp be ? IsRegExp(regexp).
601601 auto is_regexp = TRY (regexp.is_regexp (vm));
602602
@@ -782,8 +782,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::replace)
782782 // 1. Let O be ? RequireObjectCoercible(this value).
783783 auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
784784
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 ()) {
787787 // a. Let replacer be ? GetMethod(searchValue, @@replace).
788788 auto replacer = TRY (search_value.get_method (vm, vm.well_known_symbol_replace ()));
789789
@@ -861,8 +861,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::replace_all)
861861 // 1. Let O be ? RequireObjectCoercible(this value).
862862 auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
863863
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 ()) {
866866 // a. Let isRegExp be ? IsRegExp(searchValue).
867867 bool is_regexp = TRY (search_value.is_regexp (vm));
868868
@@ -977,8 +977,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::search)
977977 // 1. Let O be ? RequireObjectCoercible(this value).
978978 auto this_object = TRY (require_object_coercible (vm, vm.this_value ()));
979979
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 ()) {
982982 // a. Let searcher be ? GetMethod(regexp, @@search).
983983 auto searcher = TRY (regexp.get_method (vm, vm.well_known_symbol_search ()));
984984
@@ -1058,8 +1058,8 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::split)
10581058 // 1. Let O be ? RequireObjectCoercible(this value).
10591059 auto object = TRY (require_object_coercible (vm, vm.this_value ()));
10601060
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 ()) {
10631063 // a. Let splitter be ? GetMethod(separator, @@split).
10641064 auto splitter = TRY (separator_argument.get_method (vm, vm.well_known_symbol_split ()));
10651065 // b. If splitter is not undefined, then
0 commit comments