tor-browser

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

proto3.js (480B)


      1 // getprop, proto, 3 shapes
      2 
      3 var expected = "22,202,202,22,202,202,22,202,202,";
      4 var actual = '';
      5 
      6 var protoB = { a: 11, b: 22, c: 33 };
      7 
      8 function B() {
      9 }
     10 B.prototype = protoB;
     11 
     12 var protoC = { a: 101, b: 202, c: 303 };
     13 
     14 function C() {
     15 }
     16 C.prototype = protoC;
     17 
     18 function f() {
     19  var o1 = new B();
     20  var o2 = new C();
     21  var o3 = new C();
     22  o3.q = 99;
     23  var oa = [ o1, o2, o3 ];
     24 
     25  for (var i = 0; i < 9; ++i) {
     26    actual += oa[i%3].b + ',';
     27  }
     28 }
     29 
     30 f();
     31 
     32 assertEq(actual, expected);