diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/Environment-find-02.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/Environment-find-02.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,18 @@ +// env.find() finds nonenumerable names in the global environment. + +var g = newGlobal(); +var dbg = Debugger(g); +var hits = 0; +g.h = function () { + var env = dbg.getNewestFrame().environment; + var last = env; + while (last.parent) + last = last.parent; + + assertEq(env.find("Array"), last); + hits++; +}; + +g.eval("h();"); +g.eval("(function () { let (x = 1, y = 2) h(); })();"); +assertEq(hits, 2);