summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/closure-01.js
blob: 4c82b6fd350edb226d28a914bd6d4d2bd6f1b79c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* Non-reentrant call on an inner and outer closure. */

function foo() {
  var x = 0;
  function bar() {
    var y = 0;
    function baz() {
      return ++x + ++y;
    }
    return baz;
  }
  return bar();
}

var a = foo();
var b = foo();
assertEq(a() + a() + b() + b(), 12);