Minor fixes to RegExp match indices after r273086
https://bugs.webkit.org/show_bug.cgi?id=222157
Reviewed by Yusuke Suzuki.
JSTests:
Added a new test to verify that all flag RegExp flag combinations work round tripping
from flags to flag proerties and back.
Added standalone versions of the updated regexp-match-indices from the PR
https://github.com/tc39/test262/pull/2934 as JSTest/stress test.
Disabled the regexp-match-indices feature test in test262 until the pull request
with updated tests land and we update the WebKit version.
This is tracked in https://bugs.webkit.org/show_bug.cgi?id=222142.
* stress/regexp-all-flags.js: Added.
(flagsFromVariation):
(setPropertiesForVariation):
(missingPropertiesForVariation):
(test.let.flagsSet.get call):
(test):
* stress/test262-indices-array-element.js: Added.
(assertSameValue):
* stress/test262-indices-array-matched.js: Added.
(assertSameValue):
(assertCompareArray):
* stress/test262-indices-array-non-unicode-match.js: Added.
(assertSameValue):
(assertCompareArray):
(assertDeepEqual):
(verifyProperty):
* stress/test262-indices-array-properties.js: Added.
(verifyProperty):
* stress/test262-indices-array-unicode-match.js: Added.
(assertSameValue):
(assertCompareArray):
(assertDeepEqual):
(verifyProperty):
* stress/test262-indices-array-unicode-property-names.js: Added.
(assertCompareArray):
* stress/test262-indices-array-unmatched.js: Added.
(assertSameValue):
* stress/test262-indices-array.js: Added.
(assert):
(assertSameValue):
* stress/test262-indices-groups-object-undefined.js: Added.
(verifyProperty):
* stress/test262-indices-groups-object-unmatched.js: Added.
(assertSameValue):
(assertCompareArray):
* stress/test262-indices-groups-object.js: Added.
(assertSameValue):
(assertCompareArray):
(verifyProperty):
* stress/test262-indices-groups-properties.js: Added.
(assertCompareArray):
(verifyProperty):
* stress/test262-indices-property.js: Added.
(assertSameValue):
(verifyProperty):
* test262/config.yaml:
Source/JavaScriptCore:
When hasIndices is true, but there aren't any named groups, the spec says that we should
create the indices.groups property is the value undefined.
Increased the size of FlagsString to 7 plus terminater to account for the new 'd' flags.
* runtime/RegExpMatchesArray.h:
(JSC::createRegExpMatchesArray):
* runtime/RegExpPrototype.cpp:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@273160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/runtime/RegExpMatchesArray.h b/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
index 223b9c8..4c8ca15 100644
--- a/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
+++ b/Source/JavaScriptCore/runtime/RegExpMatchesArray.h
@@ -106,7 +106,7 @@
Structure* indicesStructure = globalObject->regExpMatchesIndicesArrayStructure();
- indicesArray->putDirect(vm, RegExpMatchesIndicesGroupsPropertyOffset, indicesGroups);
+ indicesArray->putDirect(vm, RegExpMatchesIndicesGroupsPropertyOffset, indicesGroups ? indicesGroups : jsUndefined());
ASSERT(!indicesArray->butterfly()->indexingHeader()->preCapacity(indicesStructure));
auto indicesCapacity = indicesStructure->outOfLineCapacity();