summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Object/prototype/__defineGetter__/define-abrupt.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Object/prototype/__defineGetter__/define-abrupt.js')
-rw-r--r--js/src/tests/test262/built-ins/Object/prototype/__defineGetter__/define-abrupt.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Object/prototype/__defineGetter__/define-abrupt.js b/js/src/tests/test262/built-ins/Object/prototype/__defineGetter__/define-abrupt.js
new file mode 100644
index 0000000000..b47387ea73
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Object/prototype/__defineGetter__/define-abrupt.js
@@ -0,0 +1,22 @@
+// 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 [[DefineOwnProperty]] returns an abrupt completion
+info: |
+ [...]
+ 5. Perform ? DefinePropertyOrThrow(O, key, desc).
+features: [Proxy, __getter__]
+---*/
+
+var noop = function() {};
+var thrower = function() {
+ throw new Test262Error();
+};
+var subject = new Proxy({}, { defineProperty: thrower });
+
+assert.throws(Test262Error, function() {
+ subject.__defineGetter__('attr', noop);
+});
+
+reportCompare(0, 0);