tor-browser

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

bug1273858-2.js (832B)


      1 // |jit-test| --no-threads
      2 
      3 function t1() {
      4    let x = [];
      5 
      6    try
      7    {
      8        for (let k = 0; k < 100; ++k)
      9        {
     10            let w = () => k; // Lexical capture
     11 
     12            if (w() > 10)
     13            {
     14                throw () => w; // Lexical capture
     15            }
     16 
     17            x[k] = w;
     18        }
     19    }
     20    catch (e)
     21    {
     22        // 'w' and 'k' should leave scope as exception unwinds
     23 
     24        try {
     25            eval("k");
     26            throw false;
     27        }
     28        catch (e) {
     29            if (!(e instanceof ReferenceError))
     30                throw "Loop index escaped block";
     31        }
     32 
     33        try {
     34            eval("w");
     35            throw false;
     36        }
     37        catch (e) {
     38            if (!(e instanceof ReferenceError))
     39                throw "Local name escaped block";
     40        }
     41    }
     42 }
     43 t1();
     44 t1();
     45 t1();
     46 t1();