summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-getOwnPropertyDescriptor-03.js
blob: 9a30d63d17d72c586f8b00de4e463615a2188083 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// obj.getOwnPropertyDescriptor works on global objects.

var g = newGlobal({newCompartment: true});
g.eval("var v;");
this.eval("var v;");

var dbg = Debugger();
var obj = dbg.addDebuggee(g);

function test(name) {
    var desc = obj.getOwnPropertyDescriptor(name);
    assertEq(desc instanceof Object, true);
    var expected = Object.getOwnPropertyDescriptor(this, name);
    assertEq(Object.prototype.toString.call(desc), Object.prototype.toString.call(expected));
    assertEq(desc.enumerable, expected.enumerable);
    assertEq(desc.configurable, expected.configurable);
    assertEq(desc.writable, expected.writable);
    assertEq(desc.value, expected.value);
}

test("Infinity");
test("v");