Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | var gTestcases = new Array(); |
michael@0 | 2 | function TestCase(n, d, e, a) { |
michael@0 | 3 | this.name = n; |
michael@0 | 4 | this.description = d; |
michael@0 | 5 | this.expect = e; |
michael@0 | 6 | this.actual = a; |
michael@0 | 7 | this.passed = getTestCaseResult(e, a); |
michael@0 | 8 | options.stackvalues = []; |
michael@0 | 9 | function getTestCaseResult(expected, actual) { } |
michael@0 | 10 | } |
michael@0 | 11 | var lfcode = new Array(); |
michael@0 | 12 | lfcode.push("3"); |
michael@0 | 13 | lfcode.push("var statusitems = [];\ |
michael@0 | 14 | var actualvalues = [];\ |
michael@0 | 15 | var expectedvalues = [];\ |
michael@0 | 16 | actual = '$a$^'.replace(/\\$\\^/, '--');\ |
michael@0 | 17 | actual = 'ababc'.replace(/abc/, '--');\ |
michael@0 | 18 | actual = 'ababc'.replace(/abc/g, '--');\ |
michael@0 | 19 | "); |
michael@0 | 20 | lfcode.push("\ |
michael@0 | 21 | var SECTION = \"15.4.4.3-1\";\ |
michael@0 | 22 | new TestCase( SECTION, \"Array.prototype.join.length\", 1, Array.prototype.join.length );\ |
michael@0 | 23 | new TestCase( SECTION, \"delete Array.prototype.join.length\", false, delete Array.prototype.join.length );\ |
michael@0 | 24 | new TestCase( SECTION, \"delete Array.prototype.join.length; Array.prototype.join.length\", 1, eval(\"delete Array.prototype.join.length; Array.prototype.join.length\") );\ |
michael@0 | 25 | new TestCase( SECTION, eval(\"var TEST_ARRAY = new Array(); TEST_ARRAY.join()\") );\ |
michael@0 | 26 | new TestCase( SECTION, eval(\"var TEST_ARRAY = new Array(); TEST_ARRAY.join(' ')\") );\ |
michael@0 | 27 | new TestCase( SECTION, eval(\"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('&')\") );\ |
michael@0 | 28 | new TestCase( SECTION, eval(\"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join('')\") );\ |
michael@0 | 29 | new TestCase( SECTION, eval(\"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join(void 0)\") );\ |
michael@0 | 30 | new TestCase( SECTION, eval(\"var TEST_ARRAY = new Array(null, void 0, true, false, 123, new Object(), new Boolean(true) ); TEST_ARRAY.join()\") );\ |
michael@0 | 31 | new TestCase( SECTION, eval(\"var TEST_ARRAY = new Array(true); TEST_ARRAY.join('\\v')\") );\ |
michael@0 | 32 | SEPARATOR = \"\\t\";\ |
michael@0 | 33 | new TestCase( SECTION,TEST_ARRAY.join( SEPARATOR ) );\ |
michael@0 | 34 | "); |
michael@0 | 35 | lfcode.push("new TestCase( assertEq, \"String.prototype.toString()\", \"\", String.prototype.toString() );\ |
michael@0 | 36 | new TestCase( SECTION, \"(new String()).toString()\", \"\", (new String()).toString() );\ |
michael@0 | 37 | new TestCase( SECTION, \"(new String(\\\"\\\")).toString()\", \"\", (new String(\"\")).toString() );\ |
michael@0 | 38 | new TestCase( SECTION, \"(new String( String() )).toString()\",\"\", (new String(String())).toString() );\ |
michael@0 | 39 | gczeal(4);\ |
michael@0 | 40 | new TestCase( SECTION, \"(new String( 0 )).toString()\", \"0\", (new String((1))).toString() );\ |
michael@0 | 41 | "); |
michael@0 | 42 | while (true) { |
michael@0 | 43 | var file = lfcode.shift(); if (file == undefined) { break; } |
michael@0 | 44 | loadFile(file); |
michael@0 | 45 | } |
michael@0 | 46 | function loadFile(lfVarx) { |
michael@0 | 47 | try { |
michael@0 | 48 | if (lfVarx.substr(-3) == ".js") { |
michael@0 | 49 | } else if (!isNaN(lfVarx)) { |
michael@0 | 50 | lfRunTypeId = lfVarx; |
michael@0 | 51 | } else { |
michael@0 | 52 | switch (lfRunTypeId) { |
michael@0 | 53 | default: evaluate(lfVarx); |
michael@0 | 54 | } |
michael@0 | 55 | } |
michael@0 | 56 | } catch (lfVare) {} |
michael@0 | 57 | } |