js/src/jit-test/tests/debug/Environment-names-01.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // env.names() lists nonenumerable names in with-statement environments.
     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 names = env.names();
     9     assertEq(names.indexOf("a") !== -1, true);
    11     // FIXME: Bug 748592 - proxies don't correctly propagate JSITER_HIDDEN
    12     //assertEq(names.indexOf("b") !== -1, true);
    13     //assertEq(names.indexOf("isPrototypeOf") !== -1, true);
    14     hits++;
    15 };
    16 g.eval("var obj = {a: 1};\n" +
    17        "Object.defineProperty(obj, 'b', {value: 2});\n" +
    18        "with (obj) h();");
    19 assertEq(hits, 1);

mercurial