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 | // |jit-test| allow-oom |
michael@0 | 2 | var STATUS = "STATUS: "; |
michael@0 | 3 | var callStack = new Array(); |
michael@0 | 4 | function startTest() { } |
michael@0 | 5 | function TestCase(n, d, e, a) { |
michael@0 | 6 | this.name = n; |
michael@0 | 7 | } |
michael@0 | 8 | TestCase.prototype.dump = function () {}; |
michael@0 | 9 | TestCase.prototype.testPassed = (function TestCase_testPassed() { return this.passed; }); |
michael@0 | 10 | TestCase.prototype.testFailed = (function TestCase_testFailed() { return !this.passed; }); |
michael@0 | 11 | function printStatus (msg) { |
michael@0 | 12 | var lines = msg.split ("\n"); |
michael@0 | 13 | for (var i=0; i<lines.length; i++) |
michael@0 | 14 | print (STATUS + lines[i]); |
michael@0 | 15 | } |
michael@0 | 16 | function printBugNumber (num) {} |
michael@0 | 17 | function toPrinted(value) |
michael@0 | 18 | function escapeString (str) {} |
michael@0 | 19 | function reportCompare (expected, actual, description) { |
michael@0 | 20 | var actual_t = typeof actual; |
michael@0 | 21 | var output = ""; |
michael@0 | 22 | printStatus ( |
michael@0 | 23 | "Expected value '" |
michael@0 | 24 | + toPrinted(expected) |
michael@0 | 25 | + toPrinted(actual) |
michael@0 | 26 | ); |
michael@0 | 27 | var testcase = new TestCase("unknown-test-name", description, expected, actual); |
michael@0 | 28 | testcase.reason = output; |
michael@0 | 29 | if (typeof document != "object" || !document.location.href.match(/jsreftest.html/)) { |
michael@0 | 30 | if (testcase.passed) { } |
michael@0 | 31 | } |
michael@0 | 32 | return testcase.passed; |
michael@0 | 33 | } |
michael@0 | 34 | function reportMatch (expectedRegExp, actual, description) {} |
michael@0 | 35 | function enterFunc (funcName) |
michael@0 | 36 | function BigO(data) { |
michael@0 | 37 | function LinearRegression(data) { } |
michael@0 | 38 | } |
michael@0 | 39 | function compareSource(expect, actual, summary) {} |
michael@0 | 40 | function optionsInit() { |
michael@0 | 41 | var optionNames = options().split(','); |
michael@0 | 42 | } |
michael@0 | 43 | function optionsClear() {} |
michael@0 | 44 | function optionsPush() {} |
michael@0 | 45 | optionsInit(); |
michael@0 | 46 | optionsClear(); |
michael@0 | 47 | function getTestCaseResult(expected, actual) |
michael@0 | 48 | function test() { |
michael@0 | 49 | for ( gTc=0; gTc < gTestcases.length; gTc++ ) {} |
michael@0 | 50 | } |
michael@0 | 51 | var lfcode = new Array(); |
michael@0 | 52 | lfcode.push("4"); |
michael@0 | 53 | lfcode.push("gcparam(\"maxBytes\", gcparam(\"gcBytes\") + 1024);"); |
michael@0 | 54 | lfcode.push(""); |
michael@0 | 55 | lfcode.push("\ |
michael@0 | 56 | var UBound = 0;\n\ |
michael@0 | 57 | var BUGNUMBER = 74474;\n\ |
michael@0 | 58 | var actual = '';\n\ |
michael@0 | 59 | var actualvalues = [ ];\n\ |
michael@0 | 60 | var expectedvalues = [ ];\n\ |
michael@0 | 61 | addThis();\n\ |
michael@0 | 62 | addThis();\n\ |
michael@0 | 63 | tryThis(1);\n\ |
michael@0 | 64 | function tryThis(x)\n\ |
michael@0 | 65 | addThis();\n\ |
michael@0 | 66 | test();\n\ |
michael@0 | 67 | function addThis() {\n\ |
michael@0 | 68 | actualvalues[UBound] = actual;\n\ |
michael@0 | 69 | UBound++;\n\ |
michael@0 | 70 | }\n\ |
michael@0 | 71 | function test() {\n\ |
michael@0 | 72 | enterFunc ('test');\n\ |
michael@0 | 73 | printBugNumber(BUGNUMBER);\n\ |
michael@0 | 74 | for (var i = 0; i < UBound; i++)\n\ |
michael@0 | 75 | reportCompare(expectedvalues[i], actualvalues[i], getStatus(i));\n\ |
michael@0 | 76 | }\n\ |
michael@0 | 77 | function getStatus(i) {}\n\ |
michael@0 | 78 | "); |
michael@0 | 79 | delete Debugger; |
michael@0 | 80 | while (true) { |
michael@0 | 81 | var file = lfcode.shift(); if (file == undefined) { break; } |
michael@0 | 82 | if (file == "evaluate") { |
michael@0 | 83 | } else { |
michael@0 | 84 | loadFile(file) |
michael@0 | 85 | } |
michael@0 | 86 | } |
michael@0 | 87 | function loadFile(lfVarx) { |
michael@0 | 88 | try { |
michael@0 | 89 | if (lfVarx.substr(-3) != ".js" && lfVarx.length != 1) { |
michael@0 | 90 | switch (lfRunTypeId) { |
michael@0 | 91 | case 3: function newFunc(x) { new Function(x)(); }; newFunc(lfVarx); break; |
michael@0 | 92 | case 4: eval("(function() { " + lfVarx + " })();"); break; |
michael@0 | 93 | } |
michael@0 | 94 | } else if (!isNaN(lfVarx)) { |
michael@0 | 95 | lfRunTypeId = parseInt(lfVarx); |
michael@0 | 96 | switch (lfRunTypeId) { |
michael@0 | 97 | case 3: function newFunc(x) { new Function(x)(); }; newFunc(lfVarx); break; |
michael@0 | 98 | } |
michael@0 | 99 | } |
michael@0 | 100 | } catch (lfVare) { |
michael@0 | 101 | if (lfVare instanceof SyntaxError) { } |
michael@0 | 102 | } |
michael@0 | 103 | } |