summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/setPrototypeOf/o-not-obj-coercible.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/test262/built-ins/Object/setPrototypeOf/o-not-obj-coercible.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/setPrototypeOf/o-not-obj-coercible.js b/js/src/tests/test262/built-ins/Object/setPrototypeOf/o-not-obj-coercible.js
new file mode 100644
index 0000000000..242fbed95a
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Object/setPrototypeOf/o-not-obj-coercible.js
@@ -0,0 +1,19 @@
+// Copyright (C) 2015 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+es6id: 19.1.2.18
+description: Object.setPrototypeOf invoked with a non-object-coercible value
+info: |
+ 1. Let O be RequireObjectCoercible(O).
+ 2. ReturnIfAbrupt(O).
+---*/
+
+assert.throws(TypeError, function() {
+ Object.setPrototypeOf(null);
+});
+
+assert.throws(TypeError, function() {
+ Object.setPrototypeOf(undefined);
+});
+
+reportCompare(0, 0);