PageRenderTime 17ms CodeModel.GetById 7ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

/js/src/jit-test/tests/debug/Object-defineProperty-11.js

http://github.com/zpao/v8monkey
JavaScript | 16 lines | 13 code | 2 blank | 1 comment | 0 complexity | 286273e517cdb726271290ccf59564b9 MD5 | raw file
 1// obj.defineProperty works when obj's referent is a wrapper.
 2
 3var x = {};
 4var g = newGlobal('new-compartment');
 5g.x = x;
 6var dbg = new Debugger;
 7var gw = dbg.addDebuggee(g);
 8var xw = gw.getOwnPropertyDescriptor("x").value;
 9xw.defineProperty("p", {configurable: true, enumerable: true, writable: true, value: gw});
10assertEq(x.p, g);
11
12var desc = Object.getOwnPropertyDescriptor(x, "p");
13assertEq(desc.configurable, true);
14assertEq(desc.enumerable, true);
15assertEq(desc.writable, true);
16assertEq(desc.value, g);