summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/object/setPrototypeOf-cross-realm-cycle.js
blob: e2efe010eb97c4dbcb406fdda3f783265dfb1fec (plain)
1
2
3
4
5
6
7
8
9
10
11
// The cycle check in 9.1.2 [[SetPrototypeOf]] prevents cross-realm cycles
// involving only ordinary objects.

var gw = newGlobal();

var obj = {};
var w = gw.Object.create(obj);
assertThrowsInstanceOf(() => Object.setPrototypeOf(obj, w), TypeError);
assertThrowsInstanceOf(() => gw.Object.setPrototypeOf(obj, w), gw.TypeError);

reportCompare(0, 0);