blob: 6c879598ce1e6d2a07a666de7608a2ecbeaf3c9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
// Test that objects in different compartments can have the same shape if they
// have a null proto.
var g1 = newGlobal();
var g2 = newGlobal({sameZoneAs: g1});
g1.eval("x1 = {foo: 1}");
g2.eval("x2 = {foo: 2}");
assertEq(unwrappedObjectsHaveSameShape(g1.x1, g2.x2), false);
g1.eval("x1 = Object.create(null); x1.foo = 1;");
g2.eval("x2 = Object.create(null); x2.foo = 2;");
assertEq(unwrappedObjectsHaveSameShape(g1.x1, g2.x2), true);
|