// |reftest| skip -- regexp-duplicate-named-groups is not supported // Copyright 2022 Igalia S.L. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description: Matching behavior with duplicate named capture groups esid: prod-GroupSpecifier features: [regexp-duplicate-named-groups] ---*/ assert(/(?a)|(?b)/.test("bab")); assert(/(?b)|(?a)/.test("bab")); assert(/(?:(?a)|(?b))\k/.test("aa")); assert(/(?:(?a)|(?b))\k/.test("bb")); let matchResult = /(?:(?:(?a)|(?b))\k){2}/.test("aabb"); assert(matchResult); let notMatched = /(?:(?:(?a)|(?b))\k){2}/.test("abab"); assert.sameValue(notMatched, false); reportCompare(0, 0);