summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/prototype/__lookupSetter__/key-invalid.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/__lookupSetter__/key-invalid.js')
-rw-r--r--js/src/tests/test262/built-ins/Object/prototype/__lookupSetter__/key-invalid.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/__lookupSetter__/key-invalid.js b/js/src/tests/test262/built-ins/Object/prototype/__lookupSetter__/key-invalid.js
new file mode 100644
index 0000000000..856e936cf9
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Object/prototype/__lookupSetter__/key-invalid.js
@@ -0,0 +1,23 @@
+// 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-additional-properties-of-the-object.prototype-object
+description: Behavior when property key cannot be derived
+info: |
+ [...]
+ 2. Let key be ? ToPropertyKey(P).
+features: [__setter__]
+---*/
+
+var subject = {};
+var key = {
+ toString: function() {
+ throw new Test262Error();
+ }
+};
+
+assert.throws(Test262Error, function() {
+ subject.__lookupSetter__(key);
+});
+
+reportCompare(0, 0);