Changeset 273160 in webkit


Ignore:
Timestamp:
Feb 19, 2021 12:50:48 PM (3 years ago)
Author:
msaboff@apple.com
Message:

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:
Location:
trunk
Files:
14 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r273153 r273160  
     12021-02-19  Michael Saboff  <msaboff@apple.com>
     2
     3        Minor fixes to RegExp match indices after r273086
     4        https://bugs.webkit.org/show_bug.cgi?id=222157
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Added a new test to verify that all flag RegExp flag combinations work round tripping
     9        from flags to flag proerties and back.
     10        Added standalone versions of the updated regexp-match-indices from the PR
     11        https://github.com/tc39/test262/pull/2934 as JSTest/stress test.
     12        Disabled the regexp-match-indices feature test in test262 until the pull request
     13        with updated tests land and we update the WebKit version.
     14        This is tracked in https://bugs.webkit.org/show_bug.cgi?id=222142.
     15
     16        * stress/regexp-all-flags.js: Added.
     17        (flagsFromVariation):
     18        (setPropertiesForVariation):
     19        (missingPropertiesForVariation):
     20        (test.let.flagsSet.get call):
     21        (test):
     22        * stress/test262-indices-array-element.js: Added.
     23        (assertSameValue):
     24        * stress/test262-indices-array-matched.js: Added.
     25        (assertSameValue):
     26        (assertCompareArray):
     27        * stress/test262-indices-array-non-unicode-match.js: Added.
     28        (assertSameValue):
     29        (assertCompareArray):
     30        (assertDeepEqual):
     31        (verifyProperty):
     32        * stress/test262-indices-array-properties.js: Added.
     33        (verifyProperty):
     34        * stress/test262-indices-array-unicode-match.js: Added.
     35        (assertSameValue):
     36        (assertCompareArray):
     37        (assertDeepEqual):
     38        (verifyProperty):
     39        * stress/test262-indices-array-unicode-property-names.js: Added.
     40        (assertCompareArray):
     41        * stress/test262-indices-array-unmatched.js: Added.
     42        (assertSameValue):
     43        * stress/test262-indices-array.js: Added.
     44        (assert):
     45        (assertSameValue):
     46        * stress/test262-indices-groups-object-undefined.js: Added.
     47        (verifyProperty):
     48        * stress/test262-indices-groups-object-unmatched.js: Added.
     49        (assertSameValue):
     50        (assertCompareArray):
     51        * stress/test262-indices-groups-object.js: Added.
     52        (assertSameValue):
     53        (assertCompareArray):
     54        (verifyProperty):
     55        * stress/test262-indices-groups-properties.js: Added.
     56        (assertCompareArray):
     57        (verifyProperty):
     58        * stress/test262-indices-property.js: Added.
     59        (assertSameValue):
     60        (verifyProperty):
     61        * test262/config.yaml:
     62
    1632021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
    264
  • trunk/JSTests/test262/config.yaml

    r273107 r273160  
    2424    - cleanupSome
    2525    - host-gc-required
    26     # https://bugs.webkit.org/show_bug.cgi?id=202475
     26
     27    # FIXME: https://bugs.webkit.org/show_bug.cgi?id=222142
     28    - regexp-match-indices
     29
    2730    - top-level-await
    2831  paths:
  • trunk/Source/JavaScriptCore/ChangeLog

    r273153 r273160  
     12021-02-19  Michael Saboff  <msaboff@apple.com>
     2
     3        Minor fixes to RegExp match indices after r273086
     4        https://bugs.webkit.org/show_bug.cgi?id=222157
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        When hasIndices is true, but there aren't any named groups, the spec says that we should
     9        create the indices.groups property is the value undefined.
     10        Increased the size of FlagsString to 7 plus terminater to account for the new 'd' flags.
     11
     12        * runtime/RegExpMatchesArray.h:
     13        (JSC::createRegExpMatchesArray):
     14        * runtime/RegExpPrototype.cpp:
     15
    1162021-02-19  Yusuke Suzuki  <ysuzuki@apple.com>
    217
  • trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h

    r273086 r273160  
    107107            Structure* indicesStructure = globalObject->regExpMatchesIndicesArrayStructure();
    108108
    109             indicesArray->putDirect(vm, RegExpMatchesIndicesGroupsPropertyOffset, indicesGroups);
     109            indicesArray->putDirect(vm, RegExpMatchesIndicesGroupsPropertyOffset, indicesGroups ? indicesGroups : jsUndefined());
    110110
    111111            ASSERT(!indicesArray->butterfly()->indexingHeader()->preCapacity(indicesStructure));
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r273086 r273160  
    163163}
    164164
    165 typedef std::array<char, 6 + 1> FlagsString; // 6 different flags and a null character terminator.
     165typedef std::array<char, 7 + 1> FlagsString; // 6 different flags and a null character terminator.
    166166
    167167static inline FlagsString flagsString(JSGlobalObject* globalObject, JSObject* regexp)
Note: See TracChangeset for help on using the changeset viewer.