[test262] Add new staging test for RegExp named groups

This CL adds a staging test for testing test262 bot.

Bug: v8:13173
Change-Id: I7f3d3aa3fbcf30b08cf3ebf2c61a683b7d2cf7c6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5281634
Reviewed-by: Shu-yu Guo <syg@chromium.org>
Commit-Queue: Liviu Rau <liviurau@google.com>
Cr-Commit-Position: refs/heads/main@{#92345}
This commit is contained in:
Rezvan Mahdavi Hezaveh 2024-02-15 06:54:49 -08:00 committed by test262-merge-bot
parent e98ff6c984
commit 6f7ae1f311
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
// Copyright (C) 2024 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Test different functions with duplicate names in alteration.
features: [regexp-duplicate-named-groups]
includes: [compareArray.js]
---*/
assert.compareArray(
['xxyy', undefined, 'y'], /(?:(?:(?<a>x)|(?<a>y))\k<a>){2}/.exec('xxyy'));
assert.compareArray(
['zzyyxx', 'x', undefined, undefined, undefined, undefined],
/(?:(?:(?<a>x)|(?<a>y)|(a)|(?<b>b)|(?<a>z))\k<a>){3}/.exec('xzzyyxxy'));
assert.compareArray(
['xxyy', undefined, 'y'], 'xxyy'.match(/(?:(?:(?<a>x)|(?<a>y))\k<a>){2}/));