duplicate-names-search.js (416B)
1 // Copyright 2022 Igalia S.L. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: String.prototype.search behavior with duplicate named capture groups 6 esid: prod-GroupSpecifier 7 features: [regexp-duplicate-named-groups] 8 ---*/ 9 10 assert.sameValue("xab".search(/(?<x>a)|(?<x>b)/), 1); 11 assert.sameValue("xba".search(/(?<x>a)|(?<x>b)/), 1); 12 13 reportCompare(0, 0);