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

Quantifiable assertions should be disallowed with u flag #134

Closed
JLHwung opened this issue Sep 25, 2023 · 0 comments · Fixed by #135
Closed

Quantifiable assertions should be disallowed with u flag #134

JLHwung opened this issue Sep 25, 2023 · 0 comments · Fixed by #135

Comments

@JLHwung
Copy link
Collaborator

JLHwung commented Sep 25, 2023

// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-regular-expressions-patterns
es6id: B.1.4
description: Quantifiable assertions disallowed with `u` flag
info: |
    The `u` flag precludes quantifiable assertions (even when Annex B is
    honored)

    Term[U] ::
         [~U] QuantifiableAssertion Quantifier
negative:
  phase: parse
  type: SyntaxError
---*/

$DONOTEVALUATE();

/.(?!.){2,3}/u;

In 0.9.1, regjsparser throws

SyntaxError [Error]: Expected atom at position 6
      .(?!.){2,3}

In 0.10.0, it parses successfully. This is likely a regression introduced in #131.

c.f.
https://github.com/tc39/test262/blob/main/test/language/literals/regexp/u-invalid-range-negative-lookahead.js
mathiasbynens/regexpu-core#88

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 a pull request may close this issue.

1 participant