Debian Codegraph @

js/src/jit-test/tests/debug/Object-getOwnPropertyNames-02.js

raw
1 // obj.getOwnPropertyNames() works when obj's referent is itself a cross-compartment wrapper.
2
3 var g = newGlobal({newCompartment: true});
4 var dbg = Debugger();
5 var gobj = dbg.addDebuggee(g);
6 g.p = {xyzzy: 8}; // makes a cross-compartment wrapper
7 g.p[Symbol.for("plugh")] = 9;
8 var wp = gobj.getOwnPropertyDescriptor("p").value;
9 var names = wp.getOwnPropertyNames();
10 assertEq(names.length, 1);
11 assertEq(names[0], "xyzzy");