summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-preventExtensions-01.js
blob: d5339e2d3dc1cbc5ccaf404d22442a769822b984 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Basic preventExtensions test.

var g = newGlobal({newCompartment: true});
var obj = g.eval("({x: 1})");
assertEq(g.Object.isExtensible(obj), true);

var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
var objw = gw.makeDebuggeeValue(obj);
assertEq(objw.isExtensible(), true);

assertEq(objw.preventExtensions(), undefined);
assertEq(g.Object.isExtensible(obj), false);
assertEq(objw.isExtensible(), false);

// Calling preventExtensions again has no effect.
assertEq(objw.preventExtensions(), undefined);