diff --git a/test/built-ins/RegExp/named-groups/duplicate-names.js b/test/built-ins/RegExp/named-groups/duplicate-names.js index c4a02c9484..ac801ed398 100644 --- a/test/built-ins/RegExp/named-groups/duplicate-names.js +++ b/test/built-ins/RegExp/named-groups/duplicate-names.js @@ -8,15 +8,15 @@ features: [regexp-duplicate-named-groups] includes: [compareArray.js] ---*/ -assert.compareArray(["b", "b"], "bab".match(/(?a)|(?b)/)); -assert.compareArray(["b", "b"], "bab".match(/(?b)|(?a)/)); +assert.compareArray(["b", undefined, "b"], "bab".match(/(?a)|(?b)/)); +assert.compareArray(["b", "b", undefined], "bab".match(/(?b)|(?a)/)); -assert.compareArray(["aa", "aa", undefined], "aa".match(/(?:(?a)|(?b))\k/)); -assert.compareArray(["bb", undefined, "bb"], "bb".match(/(?:(?a)|(?b))\k/)); +assert.compareArray(["aa", "a", undefined], "aa".match(/(?:(?a)|(?b))\k/)); +assert.compareArray(["bb", undefined, "b"], "bb".match(/(?:(?a)|(?b))\k/)); let matchResult = "aabb".match(/(?:(?:(?a)|(?b))\k){2}/); -assert.compareArray(["aabb", undefined, "bb"], matchResult); -assert.sameValue(matchResult.groups.x, "bb"); +assert.compareArray(["aabb", undefined, "b"], matchResult); +assert.sameValue(matchResult.groups.x, "b"); let notMatched = "abab".match(/(?:(?:(?a)|(?b))\k){2}/); assert.sameValue(notMatched, null);