js/src/jit-test/tests/ion/bug756781.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/ion/bug756781.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,19 @@
     1.4 +function AddTestCase( description, expect, actual ) {
     1.5 +  new TestCase( SECTION, description, expect, actual );
     1.6 +}
     1.7 +function TestCase(n, d, e, a) {}
     1.8 +var SECTION = "String/match-004.js";
     1.9 +re = /0./;
    1.10 +s = 10203040506070809000;
    1.11 +Number.prototype.match = String.prototype.match;
    1.12 +AddRegExpCases(  re, "re = " + re , s, String(s), 1, ["02"]);
    1.13 +AddRegExpCases(  re, re, s, ["02"]);
    1.14 +function AddRegExpCases(
    1.15 +  regexp, str_regexp, string, str_string, index, matches_array ) {
    1.16 +  if ( regexp.exec(string) == null || matches_array == null ) {
    1.17 +    AddTestCase( string.match(regexp) );
    1.18 +  }
    1.19 +  AddTestCase( string.match(regexp).input );
    1.20 +  gczeal(4);
    1.21 +}
    1.22 +

mercurial