summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/object/setPrototypeOf-same-value.js
blob: 3375509462dfa3ef85a40891b2ffdce4fdbae54b (plain)
1
2
3
4
5
6
7
8
9
10
11
// Setting a "new" prototype to the current [[Prototype]] value should never fail

var x = {}, t = Object.create(x);
Object.preventExtensions(t);
// Should not fail, because it is the same [[Prototype]] value
Object.setPrototypeOf(t, x);

// Object.prototype's [[Prototype]] is immutable, make sure we can still set null
Object.setPrototypeOf(Object.prototype, null);

reportCompare(true, true);