diff options
Diffstat (limited to 'js/src/tests/non262/object/setPrototypeOf-same-value.js')
-rw-r--r-- | js/src/tests/non262/object/setPrototypeOf-same-value.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/tests/non262/object/setPrototypeOf-same-value.js b/js/src/tests/non262/object/setPrototypeOf-same-value.js new file mode 100644 index 0000000000..3375509462 --- /dev/null +++ b/js/src/tests/non262/object/setPrototypeOf-same-value.js @@ -0,0 +1,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); |