summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/xdr/scope.js
blob: 02a135509abf0a33c8575c7460dd8f0dc6b374ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
load(libdir + 'bytecode-cache.js');
var test = "";

// code a function which has both used and unused inner functions.
test  = (function () {
  function f() {
    var x = 3;
    (function() {
      with(obj) {
        (function() {
          assertEq(x, 2);
        })();
      }
    })();
  };

  return "var obj = { x : 2 };" + f.toString() + "; f()";
})();
evalWithCache(test, { assertEqBytecode: true, assertEqResult : true });