js/src/jit-test/tests/basic/string-regexp-capture-groups.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 "abcdefg".match(/(x)y(z)/g);
     2 assertEq(RegExp.$1, "");
     4 assertEq("abcdef".match(/a(b)cd/g)[0], "abcd");
     5 assertEq(RegExp.$1, "b");
     6 assertEq(RegExp.$2, "");
     8 "abcdef".match(/(a)b(c)/g);
     9 assertEq(RegExp.$1, "a");
    10 assertEq(RegExp.$2, "c");
    11 assertEq(RegExp.$3, "");
    13 "abcabdabe".match(/(a)b(.)/g);
    14 assertEq(RegExp.$1, "a");
    15 assertEq(RegExp.$2, "e");
    17 "abcdefg".match(/(x)y(z)/g);
    18 assertEq(RegExp.$1, "a");    //If there's no match, we don't update the statics.
    20 "abcdefg".match(/(g)/g);
    21 assertEq(RegExp.$1, "g");

mercurial