summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/prototype/__proto__/set-immutable.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/__proto__/set-immutable.js')
-rw-r--r--js/src/tests/test262/built-ins/Object/prototype/__proto__/set-immutable.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/__proto__/set-immutable.js b/js/src/tests/test262/built-ins/Object/prototype/__proto__/set-immutable.js
new file mode 100644
index 0000000000..2472ca43ed
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Object/prototype/__proto__/set-immutable.js
@@ -0,0 +1,21 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+esid: sec-object.prototype.__proto__
+description: Called on an immutable prototype exotic object
+info: |
+ [...]
+ 4. Let status be ? O.[[SetPrototypeOf]](proto).
+ 5. If status is false, throw a TypeError exception.
+features: [__proto__]
+---*/
+
+Object.prototype.__proto__ = null;
+
+assert.throws(TypeError, function() {
+ Object.prototype.__proto__ = {};
+});
+
+assert.sameValue(Object.getPrototypeOf(Object.prototype), null);
+
+reportCompare(0, 0);