tor-browser

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

bug1001850.js (1743B)


      1 function t1() {
      2  assertEq(thisValue, this);
      3 }
      4 
      5 thisValue = {};
      6 var f1 = t1.bind(thisValue);
      7 f1()
      8 f1()
      9 
     10 ////////////////////////////////////////////////////////////
     11 
     12 function t2() {
     13  bailout();
     14 }
     15 
     16 var f2 = t2.bind(thisValue);
     17 f2()
     18 f2()
     19 
     20 ////////////////////////////////////////////////////////////
     21 
     22 function test3() {
     23  function i3(a,b,c,d) {
     24    bailout();
     25  }
     26 
     27  function t3(a,b,c,d) {
     28    i3(a,b,c,d);
     29  }
     30 
     31  var f3 = t3.bind(thisValue);
     32  for (var i=0;i<10; i++) {
     33    f3(1,2,3,4)
     34    f3(1,2,3,4)
     35  }
     36 }
     37 test3();
     38 test3();
     39 
     40 ////////////////////////////////////////////////////////////
     41 
     42 function test4() {
     43  this.a = 1;
     44  var inner = function(a,b,c,d) {
     45    bailout();
     46  }
     47 
     48  var t = function(a,b,c,d) {
     49    assertEq(this.a, undefined);
     50    inner(a,b,c,d);
     51    assertEq(this.a, undefined);
     52  }
     53 
     54  var f = t.bind(thisValue);
     55  for (var i=0;i<5; i++) {
     56    var res = f(1,2,3,4)
     57    var res2 = new f(1,2,3,4)
     58    assertEq(res, undefined);
     59    assertEq(res2 == undefined, false);
     60  }
     61 }
     62 test4();
     63 test4();
     64 
     65 ////////////////////////////////////////////////////////////
     66 
     67 function test5() {
     68  this.a = 1;
     69  var inner = function(a,b,c,d) {
     70    assertEq(a, 1);
     71    assertEq(b, 2);
     72    assertEq(c, 3);
     73    assertEq(d, 1);
     74    bailout();
     75    assertEq(a, 1);
     76    assertEq(b, 2);
     77    assertEq(c, 3);
     78    assertEq(d, 1);
     79  }
     80 
     81  var t = function(a,b,c,d) {
     82    inner(a,b,c,d);
     83  }
     84 
     85  var f = t.bind(thisValue, 1,2,3);
     86  for (var i=0;i<5; i++) {
     87    f(1,2,3,4)
     88  }
     89 }
     90 test5();
     91 test5();
     92 
     93 ////////////////////////////////////////////////////////////
     94 
     95 function test6() {
     96  function i6(a,b,c,d) {
     97    if (a == 1)
     98      bailout();
     99  }
    100 
    101  function t6(a,b,c,d) {
    102    i6(a,b,c,d);
    103  }
    104 
    105  var f6 = t6.bind(thisValue, 1);
    106  f6(1,2,3,4)
    107  f6(0,2,3,4)
    108 }
    109 test6();
    110 test6();