RegExp.flags: check individual flags in correct order

ECMA262 22.2.6.4 specifies that the individual boolean-valued flags
should be checked in a particular order by the RegExp.flags getter.
'hasIndices' should be first - not last.

Bug: v8:13666

Change-Id: Ic4894dce84dc2454213d06c7356db0ded792a5be
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4171640
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#85376}
This commit is contained in:
Johan Levin 2023-01-17 10:06:58 +01:00 committed by V8 LUCI CQ
parent b7cce4aa16
commit 84697034b6
3 changed files with 2 additions and 4 deletions

View File

@ -153,6 +153,7 @@ Jiawen Geng <technicalcute@gmail.com>
Jiaxun Yang <jiaxun.yang@flygoat.com> Jiaxun Yang <jiaxun.yang@flygoat.com>
Joel Stanley <joel@jms.id.au> Joel Stanley <joel@jms.id.au>
Johan Bergström <johan@bergstroem.nu> Johan Bergström <johan@bergstroem.nu>
Johan Levin <johan13@gmail.com>
John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Jonathan Liu <net147@gmail.com> Jonathan Liu <net147@gmail.com>
Juan Arboleda <soyjuanarbol@gmail.com> Juan Arboleda <soyjuanarbol@gmail.com>

View File

@ -1023,13 +1023,13 @@ TNode<String> RegExpBuiltinsAssembler::FlagsGetter(TNode<Context> context,
BIND(&next); \ BIND(&next); \
} while (false) } while (false)
CASE_FOR_FLAG("hasIndices", JSRegExp::kHasIndices);
CASE_FOR_FLAG("global", JSRegExp::kGlobal); CASE_FOR_FLAG("global", JSRegExp::kGlobal);
CASE_FOR_FLAG("ignoreCase", JSRegExp::kIgnoreCase); CASE_FOR_FLAG("ignoreCase", JSRegExp::kIgnoreCase);
CASE_FOR_FLAG("multiline", JSRegExp::kMultiline); CASE_FOR_FLAG("multiline", JSRegExp::kMultiline);
CASE_FOR_FLAG("dotAll", JSRegExp::kDotAll); CASE_FOR_FLAG("dotAll", JSRegExp::kDotAll);
CASE_FOR_FLAG("unicode", JSRegExp::kUnicode); CASE_FOR_FLAG("unicode", JSRegExp::kUnicode);
CASE_FOR_FLAG("sticky", JSRegExp::kSticky); CASE_FOR_FLAG("sticky", JSRegExp::kSticky);
CASE_FOR_FLAG("hasIndices", JSRegExp::kHasIndices);
#undef CASE_FOR_FLAG #undef CASE_FOR_FLAG
#define CASE_FOR_FLAG(NAME, V8_FLAG_EXTERN_REF, FLAG) \ #define CASE_FOR_FLAG(NAME, V8_FLAG_EXTERN_REF, FLAG) \

View File

@ -277,9 +277,6 @@
# http://crbug/v8/10905 # http://crbug/v8/10905
'language/identifier-resolution/assign-to-global-undefined': [FAIL], 'language/identifier-resolution/assign-to-global-undefined': [FAIL],
# http://crbug/v8/11531
'built-ins/RegExp/prototype/flags/get-order': [FAIL],
# http://crbug/v8/11533 # http://crbug/v8/11533
'language/statements/class/subclass/default-constructor-spread-override': [FAIL], 'language/statements/class/subclass/default-constructor-spread-override': [FAIL],