tor-browser

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

propertyOptimize-2.js (292B)


      1 function Foo(x)
      2 {
      3  this.f = x + 10;
      4 }
      5 
      6 var x = new Foo(0);
      7 assertEq(10, eval("x.f"));
      8 
      9 called = false;
     10 Object.defineProperty(Foo.prototype, 'f', {set: function() { called = true; }});
     11 
     12 var y = new Foo(0);
     13 assertEq(10, eval("x.f"));
     14 assertEq(undefined, eval("y.f"));
     15 assertEq(called, true);