tor-browser

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

objectfuse-global-invalidate-accessor.js (379B)


      1 // |jit-test| --fast-warmup
      2 function changeMath(i) {
      3  with (this) {} // Don't inline.
      4  if (i === 1980) {
      5    Object.defineProperty(globalThis, "Math", {get: function() {
      6      return {abs: function() { return -1; }};
      7    }});
      8  }
      9 }
     10 function f() {
     11  var res = 0;
     12  for (var i = 0; i < 2000; i++) {
     13    res += Math.abs(i);
     14    changeMath(i);
     15  }
     16  assertEq(res, 1961171);
     17 }
     18 f();