Skip to content

Fix problem with regex constructor#1552

Merged
gbrail merged 1 commit intomozilla:masterfrom
andreabergia:fix-regexp-constructor
Aug 9, 2024
Merged

Fix problem with regex constructor#1552
gbrail merged 1 commit intomozilla:masterfrom
andreabergia:fix-regexp-constructor

Conversation

@andreabergia
Copy link
Contributor

@andreabergia andreabergia commented Aug 2, 2024

The spec for ES6 says that we can create a new regex passing an existing one and a different set of flags, but that does not work. This PR fixes it (while keeping the old behavior for ES5 and below). We also now pass a few more test262 cases.

Spec link: https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-constructor

(If accepted, please squash this PR 🙂 )

@andreabergia andreabergia marked this pull request as draft August 2, 2024 12:10
@andreabergia andreabergia force-pushed the fix-regexp-constructor branch from 5f103da to 2c812f4 Compare August 2, 2024 12:58
@andreabergia andreabergia marked this pull request as ready for review August 2, 2024 13:25
@gbrail
Copy link
Collaborator

gbrail commented Aug 8, 2024

Looks good -- but now that we just updated test262, could you please rebase your PR on top of the latest? (And also you'll want to "git submodule update" after doing that...) Thanks!

The spec says that we can create a new regex passing an existing one and
a different set of flags, but that does not work. This PR fixes it.
We also now pass a few more test262 cases.
@andreabergia andreabergia force-pushed the fix-regexp-constructor branch from 2c812f4 to 7b2f7cf Compare August 8, 2024 07:13
@andreabergia
Copy link
Contributor Author

Rebased on top of master and the latest test262 suite

@gbrail
Copy link
Collaborator

gbrail commented Aug 9, 2024

Looks good -- thanks!

@gbrail gbrail merged commit 7d1f5b7 into mozilla:master Aug 9, 2024
@andreabergia andreabergia deleted the fix-regexp-constructor branch August 14, 2024 14:26
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.

2 participants