comparison: js/src/jit-test/tests/debug/Environment-find-02.js
js/src/jit-test/tests/debug/Environment-find-02.js
- changeset 0
- 6474c204b198
equal
deleted
inserted
replaced
|
1 // env.find() finds nonenumerable names in the global environment. |
|
2 |
|
3 var g = newGlobal(); |
|
4 var dbg = Debugger(g); |
|
5 var hits = 0; |
|
6 g.h = function () { |
|
7 var env = dbg.getNewestFrame().environment; |
|
8 var last = env; |
|
9 while (last.parent) |
|
10 last = last.parent; |
|
11 |
|
12 assertEq(env.find("Array"), last); |
|
13 hits++; |
|
14 }; |
|
15 |
|
16 g.eval("h();"); |
|
17 g.eval("(function () { let (x = 1, y = 2) h(); })();"); |
|
18 assertEq(hits, 2); |