PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Object-getOwnPropertyDescriptor-05.js

http://github.com/zpao/v8monkey
JavaScript | 17 lines | 14 code | 2 blank | 1 comment | 0 complexity | d316b4016bfa4e9a176063f03dbcb1d6 MD5 | raw file
 1// obj.getOwnPropertyDescriptor presents getters and setters as Debugger.Object objects.
 2
 3var g = newGlobal('new-compartment');
 4g.S = function foreignFunction(v) {};
 5g.eval("var a = {};\n" +
 6       "function G() {}\n" +
 7       "Object.defineProperty(a, 'p', {get: G, set: S})");
 8
 9var dbg = new Debugger;
10var gdo = dbg.addDebuggee(g);
11var desc = gdo.getOwnPropertyDescriptor("a").value.getOwnPropertyDescriptor("p");
12assertEq(desc.enumerable, false);
13assertEq(desc.configurable, false);
14assertEq("value" in desc, false);
15assertEq("writable" in desc, false);
16assertEq(desc.get, gdo.getOwnPropertyDescriptor("G").value);
17assertEq(desc.set, gdo.getOwnPropertyDescriptor("S").value);