Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/named-groups/duplicate-names-split.js

raw
1 // |reftest| shell-option(--enable-regexp-duplicate-named-groups) skip-if(!xulRuntime.shell) -- requires shell-options
2 // Copyright 2022 Igalia S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 description: String.prototype.search behavior with duplicate named capture groups
7 esid: prod-GroupSpecifier
8 includes: [compareArray.js]
9 features: [regexp-duplicate-named-groups]
10 ---*/
11
12 assert.compareArray("xab".split(/(?<x>a)|(?<x>b)/), ["x", "a", undefined, "", undefined, "b", ""]);
13 assert.compareArray("xba".split(/(?<x>a)|(?<x>b)/), ["x", undefined, "b", "", "a", undefined, ""]);
14
15 reportCompare(0, 0);