summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js')
-rw-r--r--js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js b/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js
new file mode 100644
index 0000000000..3eb4d9d14c
--- /dev/null
+++ b/js/src/tests/test262/built-ins/DataView/prototype/setBigInt64/return-abrupt-from-tobigint-value.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2017 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.setbigint64
+description: >
+ Return abrupt from ToBigInt(value)
+features: [DataView, ArrayBuffer, BigInt]
+---*/
+
+var buffer = new ArrayBuffer(8);
+var sample = new DataView(buffer, 0);
+
+var bo1 = {
+ valueOf() {
+ throw new Test262Error();
+ }
+};
+var bo2 = {
+ toString() {
+ throw new Test262Error();
+ }
+};
+
+assert.throws(Test262Error, function() {
+ sample.setBigInt64(0, bo1);
+}, "valueOf");
+
+assert.throws(Test262Error, function() {
+ sample.setBigInt64(0, bo2);
+}, "toString");
+
+reportCompare(0, 0);