Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to regexp-match-indices tests based on d-flag #2934

Merged
merged 4 commits into from
Feb 25, 2021

Conversation

rbuckton
Copy link
Contributor

@rbuckton rbuckton commented Jan 15, 2021

Updates based on the changes from tc39/proposal-regexp-match-indices#49

NOTE: Its not yet clear if there are any public implementations that have adopted this change as of yet.

@rwaldron rwaldron requested a review from jugglinmike January 18, 2021 17:54
@iainireland
Copy link

Data point: I have prototyped an implementation of regexp-match-indices with the /d flag in SpiderMonkey, but we are waiting on the updated test262 tests before shipping.

It looks like V8 has already landed their implementation with /d (guarded behind a flag).

@Constellation
Copy link
Member

WebKit/WebKit@7e63c11 JSC change is also ready.

msaboff
msaboff previously approved these changes Feb 19, 2021
Copy link

@msaboff msaboff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks mostly good. I think there are a couple of copy-paste errors as I commented below for tests test/built-ins/RegExp/match-indices/indices-groups-object-undefined.js and test/built-ins/RegExp/prototype/flags/coercion-hasIndices.js.

It also looks like there is some existing dead code in test/built-ins/RegExp/match-indices/indices-groups-properties.js

webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this pull request Feb 19, 2021
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
tc39/test262#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:


Canonical link: https://commits.webkit.org/234355@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
philn pushed a commit to philn/old-webkit that referenced this pull request Feb 21, 2021
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
tc39/test262#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
msaboff
msaboff previously approved these changes Feb 22, 2021
Copy link

@msaboff msaboff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for taking care of those quickly.

@rbuckton
Copy link
Contributor Author

rbuckton commented Feb 23, 2021

FYI: I'll be putting up a PR against engine262 for the updates as well. I've been using it to verify tests locally since all of the changes fail on circleci right now.

@rbuckton
Copy link
Contributor Author

@rwaldron can you review and (hopefully) merge?

@rbuckton
Copy link
Contributor Author

ping: @rwaldron, @leobalter I'd appreciate a review, thanks.

@rwaldron rwaldron merged commit 0d922dd into tc39:main Feb 25, 2021
@rbuckton rbuckton deleted the match-indices-d-flag branch February 25, 2021 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants