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

Fix invert astral capture regression #89

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

JLHwung
Copy link
Collaborator

@JLHwung JLHwung commented Sep 25, 2023

Fix Babel test262 errors from recent regressions

not ok 11237 test/language/literals/regexp/u-astral-char-class-invert.js default # (expected success, got runtime error)
  ---
  name: Test262Error
  message: 'Expected SameValue(«�», «null») to be true'
  stack: >
    Test262Error: Expected SameValue(«�», «null») to be true

    /home/runner/work/babel/babel/babel-test262-runner/lib/run-tests/index.js:80:17

  ...
not ok 11239 test/language/literals/regexp/u-astral-char-class-invert.js strict mode # (expected success, got runtime error)
  ---
  name: Test262Error
  message: 'Expected SameValue(«�», «null») to be true'
  stack: >
    Test262Error: Expected SameValue(«�», «null») to be true

    /home/runner/work/babel/babel/babel-test262-runner/lib/run-tests/index.js:80:17

Other test262 errors will be tracked in jviereck/regjsparser#134

assert.match(match, transpiledRegex);
}
for (const nonMatch of fixture.nonMatches || []) {
const transpiledRegex = new RegExp(`^${transpiled}$`, getOutputFlags(flag, options));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding ^ and $ does affect the capturing behaviour, which is why the bug is not caught in previous tests. Here we construct test regex directly from the transpiled regex.

@JLHwung JLHwung merged commit 2a9179f into mathiasbynens:main Sep 13, 2024
3 checks passed
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