tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

duplicate-names-split.js (536B)


      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 includes: [compareArray.js]
      8 features: [regexp-duplicate-named-groups]
      9 ---*/
     10 
     11 assert.compareArray("xab".split(/(?<x>a)|(?<x>b)/), ["x", "a", undefined, "", undefined, "b", ""]);
     12 assert.compareArray("xba".split(/(?<x>a)|(?<x>b)/), ["x", undefined, "b", "", "a", undefined, ""]);
     13 
     14 reportCompare(0, 0);