js/src/tests/js1_8_5/regress/regress-yarr-regexp.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 function toSource(o) { return o === null ? "null" : o.toSource(); }
     3 var gcgcz = /((?:.)+)((?:.)*)/; /* Greedy capture, greedy capture zero. */
     4 reportCompare(["a", "a", ""].toSource(), gcgcz.exec("a").toSource());
     5 reportCompare(["ab", "ab", ""].toSource(), gcgcz.exec("ab").toSource());
     6 reportCompare(["abc", "abc", ""].toSource(), gcgcz.exec("abc").toSource());
     8 reportCompare(["a", ""].toSource(), toSource(/((?:)*?)a/.exec("a")));
     9 reportCompare(["a", ""].toSource(), toSource(/((?:.)*?)a/.exec("a")));
    10 reportCompare(["a", ""].toSource(), toSource(/a((?:.)*)/.exec("a")));
    12 reportCompare(["B", "B"].toSource(), toSource(/([A-Z])/.exec("fooBar")));
    14 // These just mustn't crash. See bug 872971
    15 try { reportCompare(/x{2147483648}x/.test('1'), false); } catch (e) {}
    16 try { reportCompare(/x{2147483648,}x/.test('1'), false); } catch (e) {}
    17 try { reportCompare(/x{2147483647,2147483648}x/.test('1'), false); } catch (e) {}
    18 // Same for these. See bug 813366
    19 try { reportCompare("".match(/.{2147483647}11/), null); } catch (e) {}
    20 try { reportCompare("".match(/(?:(?=g)).{2147483648,}/ + ""), null); } catch (e) {}

mercurial