tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

bug1195452.js (874B)


      1 // |jit-test| allow-oom; allow-unhandlable-oom
      2 
      3 var lfcode = new Array();
      4 lfcode.push(`
      5 function TestCase(e) {
      6    this.expect = e;
      7 }
      8 function writeHeaderToLog() {}
      9 var SECTION = "15.5.4.7-1";
     10 var TITLE = "String.protoype.lastIndexOf";
     11 writeHeaderToLog();
     12 var j = 0;
     13 for (k = 0, i = 0x0021; i < 0x007e; i++, j++, k++)
     14    new TestCase("x" - 1);
     15 LastIndexOf();
     16 function LastIndexOf() {
     17    if (isNaN(n)) {}
     18 }
     19 `);
     20 lfcode.push(`
     21 oomAfterAllocations(50);
     22 writeHeaderToLog(SECTION + " " + TITLE);
     23 var expect = "Passed";
     24 try {
     25    eval("this = true");
     26 } catch (e) {
     27    result = expect;
     28    exception = e.toString(0, 0);
     29 }
     30 new TestCase();
     31 `);
     32 while (lfcode.length > 0) {
     33    var file = lfcode.shift();
     34    loadFile(file)
     35 }
     36 function loadFile(lfVarx) {
     37    try {
     38        if (lfVarx.substr(-3) != ".js" && lfVarx.length != 1) {
     39 evaluate(lfVarx);
     40        }
     41    } catch (lfVare) {}
     42 }