Debian Codegraph @

js/src/tests/test262/built-ins/RegExp/named-groups/duplicate-names-search.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 features: [regexp-duplicate-named-groups]
9 ---*/
10
11 assert.sameValue("xab".search(/(?<x>a)|(?<x>b)/), 1);
12 assert.sameValue("xba".search(/(?<x>a)|(?<x>b)/), 1);
13
14 reportCompare(0, 0);