tor-browser

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

inline-arguments-exists-negative-index-1.js (577B)


      1 // |jit-test| --fast-warmup
      2 
      3 function inner(i) {
      4  return i in arguments;
      5 }
      6 
      7 function outer(i) {
      8  trialInline();
      9 
     10  // Loop header to trigger OSR.
     11  let r = 0;
     12  for (let j = 0; j < 1; ++j) {
     13    r += inner(i,
     14      // Add extra arguments to ensure we read the arguments from the frame.
     15      0, 0, 0, 0,
     16      0, 0, 0, 0,
     17      0, 0, 0, 0,
     18      0, 0, 0, 0,
     19      0, 0, 0, 0,
     20    );
     21  }
     22  return r;
     23 }
     24 
     25 let count = 0;
     26 
     27 for (let i = 0; i <= 100; ++i) {
     28    if (i === 50) {
     29      Object.prototype[-1] = 0;
     30    }
     31    count += outer(i < 100 ? i : -1);
     32 }
     33 
     34 assertEq(count, 1 + 21);