Don't call well-known Symbol methods for RegExp on primitive values

This commit is contained in:
Fabrice Bellard
2025-12-11 19:27:19 +01:00
parent 1dbba8a88e
commit c73a435f36
3 changed files with 4 additions and 52 deletions

2
TODO
View File

@@ -63,4 +63,4 @@ Test262o: 0/11262 errors, 463 excluded
Test262o commit: 7da91bceb9ce7613f87db47ddd1292a2dda58b42 (es5-tests branch)
Test262:
Result: 66/83295 errors, 2590 excluded, 5767 skipped
Result: 66/83341 errors, 2567 excluded, 5767 skipped

View File

@@ -45142,7 +45142,7 @@ static JSValue js_string_match(JSContext *ctx, JSValueConst this_val,
if (JS_IsUndefined(O) || JS_IsNull(O))
return JS_ThrowTypeError(ctx, "cannot convert to object");
if (!JS_IsUndefined(regexp) && !JS_IsNull(regexp)) {
if (JS_IsObject(regexp)) {
matcher = JS_GetProperty(ctx, regexp, atom);
if (JS_IsException(matcher))
return JS_EXCEPTION;
@@ -45322,7 +45322,7 @@ static JSValue js_string_replace(JSContext *ctx, JSValueConst this_val,
replaceValue_str = JS_UNDEFINED;
repl_str = JS_UNDEFINED;
if (!JS_IsUndefined(searchValue) && !JS_IsNull(searchValue)) {
if (JS_IsObject(searchValue)) {
JSValue replacer;
if (is_replaceAll) {
if (check_regexp_g_flag(ctx, searchValue) < 0)
@@ -45433,7 +45433,7 @@ static JSValue js_string_split(JSContext *ctx, JSValueConst this_val,
A = JS_UNDEFINED;
R = JS_UNDEFINED;
if (!JS_IsUndefined(separator) && !JS_IsNull(separator)) {
if (JS_IsObject(separator)) {
JSValue splitter;
splitter = JS_GetProperty(ctx, separator, JS_ATOM_Symbol_split);
if (JS_IsException(splitter))

View File

@@ -255,54 +255,6 @@ test262/test/built-ins/ThrowTypeError/unique-per-realm-function-proto.js
#test262/test/built-ins/RegExp/CharacterClassEscapes/
#test262/test/built-ins/RegExp/property-escapes/
# not yet in official specification
test262/test/built-ins/String/prototype/match/cstm-matcher-on-bigint-primitive.js
test262/test/built-ins/String/prototype/match/cstm-matcher-on-bigint-primitive.js
test262/test/built-ins/String/prototype/match/cstm-matcher-on-boolean-primitive.js
test262/test/built-ins/String/prototype/match/cstm-matcher-on-boolean-primitive.js
test262/test/built-ins/String/prototype/match/cstm-matcher-on-number-primitive.js
test262/test/built-ins/String/prototype/match/cstm-matcher-on-number-primitive.js
test262/test/built-ins/String/prototype/match/cstm-matcher-on-string-primitive.js
test262/test/built-ins/String/prototype/match/cstm-matcher-on-string-primitive.js
test262/test/built-ins/String/prototype/matchAll/cstm-matchall-on-bigint-primitive.js
test262/test/built-ins/String/prototype/matchAll/cstm-matchall-on-bigint-primitive.js
test262/test/built-ins/String/prototype/matchAll/cstm-matchall-on-number-primitive.js
test262/test/built-ins/String/prototype/matchAll/cstm-matchall-on-number-primitive.js
test262/test/built-ins/String/prototype/matchAll/cstm-matchall-on-string-primitive.js
test262/test/built-ins/String/prototype/matchAll/cstm-matchall-on-string-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-bigint-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-bigint-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-boolean-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-boolean-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-number-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-number-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-string-primitive.js
test262/test/built-ins/String/prototype/replace/cstm-replace-on-string-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-bigint-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-bigint-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-boolean-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-boolean-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-number-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-number-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-string-primitive.js
test262/test/built-ins/String/prototype/replaceAll/cstm-replaceall-on-string-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-bigint-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-bigint-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-boolean-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-boolean-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-number-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-number-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-string-primitive.js
test262/test/built-ins/String/prototype/search/cstm-search-on-string-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-bigint-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-bigint-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-boolean-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-boolean-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-number-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-number-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-string-primitive.js
test262/test/built-ins/String/prototype/split/cstm-split-on-string-primitive.js
####################################
# staging tests