Add tests for RegExp `v` flag errors that were allowed with `u`

https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag

Issue: #3496
Issue: https://github.com/tc39/proposal-regexp-v-flag/issues/52
This commit is contained in:
Mathias Bynens 2023-04-26 11:36:58 +02:00 committed by Jordan Harband
parent 72c0c5e163
commit 1010e63caf
28 changed files with 532 additions and 0 deletions

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[(]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[)]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[[]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[{]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[}]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[/]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[-]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[|]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[&&]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[!!]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[##]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[$$]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[%%]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[**]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[++]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[,,]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[..]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[::]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[;;]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[<<]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[==]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[>>]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[??]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[@@]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[``]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[~~]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[^^^]/v;

View File

@ -0,0 +1,19 @@
// Copyright 2023 Mathias Bynens. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
author: Mathias Bynens
description: >
Some previously valid patterns with the `u` flag are now expected to
throw an early SyntaxError with the `v` flag.
https://github.com/tc39/proposal-regexp-v-flag#how-is-the-v-flag-different-from-the-u-flag
esid: sec-parsepattern
negative:
phase: parse
type: SyntaxError
features: [regexp-v-flag]
---*/
$DONOTEVALUATE();
/[_^^]/v;