summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/jaeger/testBug550743.js
blob: 50349d6a3a3e069963435bb10f62fbeda1d274d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
expected = '';

function g(code) {
  f = Function(code);
  gen = f();
  gen.next();
  try { gen.next(); } catch (ex) { expected = ex.toString() }
}

g("\
  yield this.__defineGetter__('x', function(){ return z }); \
  let z = new String('hi'); \
  ");

eval();
gc();

str = x;

assertEq(expected, "[object StopIteration]");
assertEq(str.toString(), "hi");