summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Templeton <robin@igalia.com>2017-10-24 11:48:34 -0400
committerRobin Templeton <robin@igalia.com>2017-10-24 11:48:34 -0400
commitcca387688109482e2532b44dca6f61447e58f934 (patch)
tree02d4207e11c0b9421e54d521a84c8cdf5b8d5dbf
parenta456b0a390bb0f70b4cb8d38cb5ab0ecb557a851 (diff)
downloadqtdeclarative-testsuites-cca387688109482e2532b44dca6f61447e58f934.tar.gz
getBigInt64
-rw-r--r--harness/typeCoercion.js18
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js34
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js34
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js29
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js75
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/length.js32
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/name.js31
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js29
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js28
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js31
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js48
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js68
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/return-values.js69
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/this-has-no-dataview-internal.js34
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js37
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js53
-rw-r--r--test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js54
17 files changed, 704 insertions, 0 deletions
diff --git a/harness/typeCoercion.js b/harness/typeCoercion.js
index ed03805d7..26599d216 100644
--- a/harness/typeCoercion.js
+++ b/harness/typeCoercion.js
@@ -323,6 +323,24 @@ function testNotCoercibleToString(test) {
testNotCoercibleToPrimitive("string", test);
}
+function testCoercibleToBooleanTrue(test) {
+ test(true);
+ test(1);
+ test("string");
+ test(Symbol("1"));
+ test({});
+}
+
+function testCoercibleToBooleanFalse(test) {
+ test(undefined);
+ test(null);
+ test(false);
+ test(0);
+ test(-0);
+ test(NaN);
+ test("");
+}
+
function testCoercibleToBigIntZero(test) {
function testPrimitiveValue(value) {
test(value);
diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js
new file mode 100644
index 000000000..8a3d35d67
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-after-toindex-byteoffset.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Detached buffer is only checked after ToIndex(requestIndex)
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 4. Let getIndex be ? ToIndex(requestIndex).
+ ...
+ 6. Let buffer be view.[[ViewedArrayBuffer]].
+ 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
+ ...
+includes: [detachArrayBuffer.js]
+features: [DataView, ArrayBuffer, BigInt, arrow-function]
+---*/
+
+var buffer = new ArrayBuffer(8);
+var sample = new DataView(buffer, 0);
+
+$DETACHBUFFER(buffer);
+
+assert.throws(RangeError, () => sample.getBigInt64(Infinity), "Infinity");
+
+assert.throws(RangeError, () => sample.getBigInt64(-1), "-1");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js
new file mode 100644
index 000000000..1c6c4259b
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer-before-outofrange-byteoffset.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Detached buffer is checked before out of range byteOffset's value
+info: |
+ 24.2.4.8 DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 6. Let buffer be view.[[ViewedArrayBuffer]].
+ 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
+ ...
+ 11. If getIndex + elementSize > viewSize, throw a RangeError exception.
+ ...
+includes: [detachArrayBuffer.js]
+features: [DataView, ArrayBuffer, BigInt, arrow-function]
+---*/
+
+var sample;
+var buffer = new ArrayBuffer(12);
+
+sample = new DataView(buffer, 0);
+
+$DETACHBUFFER(buffer);
+
+assert.throws(TypeError, () => sample.getBigInt64(13), "13");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js
new file mode 100644
index 000000000..19973b4ed
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/detached-buffer.js
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Throws a TypeError if buffer is detached
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 8. Let buffer be the value of view's [[ViewedArrayBuffer]] internal slot.
+ 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.
+ ...
+includes: [detachArrayBuffer.js]
+features: [DataView, ArrayBuffer, BigInt, arrow-function]
+---*/
+
+var buffer = new ArrayBuffer(1);
+var sample = new DataView(buffer, 0);
+
+$DETACHBUFFER(buffer);
+assert.throws(TypeError, () => sample.getBigInt64(0), "0");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js b/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js
new file mode 100644
index 000000000..9610d7a6e
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/index-is-out-of-range.js
@@ -0,0 +1,75 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Throws a RangeError if getIndex + elementSize > viewSize
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 10. Let viewOffset be the value of view's [[ByteOffset]] internal slot.
+ 11. Let viewSize be the value of view's [[ByteLength]] internal slot.
+ 12. Let elementSize be the Number value of the Element Size value specified in
+ Table 50 for Element Type type.
+ 13. If getIndex + elementSize > viewSize, throw a RangeError exception.
+ ...
+features: [DataView, ArrayBuffer, BigInt, arrow-function]
+---*/
+
+var sample;
+var buffer = new ArrayBuffer(12);
+
+sample = new DataView(buffer, 0);
+
+assert.throws(RangeError, () => sample.getBigInt64(Infinity),
+ "Infinity");
+
+assert.throws(RangeError, () => sample.getBigInt64(13), "13 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(12), "12 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(11), "11 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(10), "10 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(9), "9 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(8), "8 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(7), "7 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(6), "6 + 8 > 12");
+
+assert.throws(RangeError, () => sample.getBigInt64(5), "5 + 8 > 12");
+
+sample = new DataView(buffer, 8);
+assert.throws(RangeError, () => sample.getBigInt64(1),
+ "1 + 8 > 4 (offset)");
+
+sample = new DataView(buffer, 9);
+assert.throws(RangeError, () => sample.getBigInt64(0),
+ "0 + 8 > 3 (offset)");
+
+sample = new DataView(buffer, 0, 8);
+assert.throws(RangeError, () => sample.getBigInt64(1),
+ "1 + 8 > 8 (length)");
+
+sample = new DataView(buffer, 0, 7);
+assert.throws(RangeError, () => sample.getBigInt64(0),
+ "0 + 8 > 7 (length)");
+
+sample = new DataView(buffer, 4, 8);
+assert.throws(RangeError, () => sample.getBigInt64(1),
+ "1 + 8 > 8 (offset+length)");
+
+sample = new DataView(buffer, 4, 7);
+assert.throws(RangeError, () => sample.getBigInt64(0),
+ "0 + 8 > 7 (offset+length)");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/length.js b/test/built-ins/DataView/prototype/getBigInt64/length.js
new file mode 100644
index 000000000..1273ccd82
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/length.js
@@ -0,0 +1,32 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: DataView.prototype.getBigInt64.length property descriptor
+info: >
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 17 ECMAScript Standard Built-in Objects
+
+ Every built-in function object, including constructors, has a length
+ property whose value is an integer. Unless otherwise specified, this
+ value is equal to the largest number of named arguments shown in the
+ subclause headings for the function description. Optional parameters
+ (which are indicated with brackets: [ ]) or rest parameters (which
+ are shown using the form «...name») are not included in the default
+ argument count.
+
+ Unless otherwise specified, the length property of a built-in
+ function object has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [DataView, ArrayBuffer, BigInt]
+---*/
+
+verifyProperty(DataView.prototype.getBigInt64, "length", {
+ value: 1,
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
diff --git a/test/built-ins/DataView/prototype/getBigInt64/name.js b/test/built-ins/DataView/prototype/getBigInt64/name.js
new file mode 100644
index 000000000..0983ea447
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/name.js
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: DataView.prototype.getBigInt64.name property descriptor
+info: >
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 17 ECMAScript Standard Built-in Objects
+
+ Every built-in function object, including constructors, that is not
+ identified as an anonymous function has a name property whose value
+ is a String. Unless otherwise specified, this value is the name that
+ is given to the function in this specification. For functions that
+ are specified as properties of objects, the name value is the
+ property name string used to access the function. [...]
+
+ Unless otherwise specified, the name property of a built-in function
+ object, if it exists, has the attributes { [[Writable]]: false,
+ [[Enumerable]]: false, [[Configurable]]: true }.
+includes: [propertyHelper.js]
+features: [DataView, ArrayBuffer, BigInt]
+---*/
+
+verifyProperty(DataView.prototype.getBigInt64, "name", {
+ value: "getBigInt64",
+ writable: false,
+ enumerable: false,
+ configurable: true
+});
diff --git a/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js b/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js
new file mode 100644
index 000000000..e03b2274a
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/negative-byteoffset-throws.js
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Throws a RangeError if getIndex < 0
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 4. Let getIndex be ? ToIndex(requestIndex).
+ ...
+features: [DataView, ArrayBuffer, BigInt, arrow-function]
+---*/
+
+var buffer = new ArrayBuffer(12);
+var sample = new DataView(buffer, 0);
+
+assert.throws(RangeError, () => sample.getBigInt64(-1), "-1");
+
+assert.throws(RangeError, () => sample.getBigInt64(-Infinity),
+ "-Infinity");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js
new file mode 100644
index 000000000..db10b117c
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset-symbol.js
@@ -0,0 +1,28 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Return abrupt from ToNumber(symbol byteOffset)
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 4. Let getIndex be ? ToNumber(requestIndex).
+ ...
+features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function]
+---*/
+
+var buffer = new ArrayBuffer(1);
+var sample = new DataView(buffer, 0);
+
+var s = Symbol("1");
+
+assert.throws(TypeError, () => sample.getBigInt64(s));
diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js
new file mode 100644
index 000000000..d286e5870
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/return-abrupt-from-tonumber-byteoffset.js
@@ -0,0 +1,31 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Return abrupt from ToNumber(byteOffset)
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 4. Let getIndex be ? ToNumber(requestIndex).
+ ...
+features: [DataView, ArrayBuffer, BigInt, arrow-function]
+---*/
+
+var buffer = new ArrayBuffer(1);
+var sample = new DataView(buffer, 0);
+
+var bo1 = { valueOf() { throw new Test262Error(); } };
+var bo2 = { toString() { throw new Test262Error(); } };
+
+assert.throws(Test262Error, () => sample.getBigInt64(bo1), "valueOf");
+
+assert.throws(Test262Error, () => sample.getBigInt64(bo2), "toString");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js b/test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js
new file mode 100644
index 000000000..06b1f4edf
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/return-value-clean-arraybuffer.js
@@ -0,0 +1,48 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Return value from Buffer using a clean ArrayBuffer
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 12. Let bufferIndex be getIndex + viewOffset.
+ 13. Return GetValueFromBuffer(buffer, bufferIndex, type, false,
+ "Unordered", isLittleEndian).
+
+ 24.1.1.6 GetValueFromBuffer ( arrayBuffer, byteIndex, type,
+ isTypedArray, order [ , isLittleEndian ] )
+
+ ...
+ 9. Return RawBytesToNumber(type, rawValue, isLittleEndian).
+
+ 24.1.1.5 RawBytesToNumber( type, rawBytes, isLittleEndian )
+
+ ...
+ 2. If isLittleEndian is false, reverse the order of the elements of rawBytes.
+ ...
+features: [DataView, ArrayBuffer, BigInt]
+---*/
+
+var buffer = new ArrayBuffer(12);
+var sample = new DataView(buffer, 0);
+
+assert.sameValue(sample.getBigInt64(0, true), 0n, "sample.getBigInt64(0, true)");
+assert.sameValue(sample.getBigInt64(1, true), 0n, "sample.getBigInt64(1, true)");
+assert.sameValue(sample.getBigInt64(2, true), 0n, "sample.getBigInt64(2, true)");
+assert.sameValue(sample.getBigInt64(3, true), 0n, "sample.getBigInt64(3, true)");
+assert.sameValue(sample.getBigInt64(4, true), 0n, "sample.getBigInt64(4, true)");
+assert.sameValue(sample.getBigInt64(0, false), 0n, "sample.getBigInt64(0, false)");
+assert.sameValue(sample.getBigInt64(1, false), 0n, "sample.getBigInt64(1, false)");
+assert.sameValue(sample.getBigInt64(2, false), 0n, "sample.getBigInt64(2, false)");
+assert.sameValue(sample.getBigInt64(3, false), 0n, "sample.getBigInt64(3, false)");
+assert.sameValue(sample.getBigInt64(4, false), 0n, "sample.getBigInt64(4, false)");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js b/test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js
new file mode 100644
index 000000000..02455952b
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/return-values-custom-offset.js
@@ -0,0 +1,68 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Return values from Buffer using a custom offset
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 12. Let bufferIndex be getIndex + viewOffset.
+ 13. Return GetValueFromBuffer(buffer, bufferIndex, type, false,
+ "Unordered", isLittleEndian).
+
+ 24.1.1.6 GetValueFromBuffer ( arrayBuffer, byteIndex, type,
+ isTypedArray, order [ , isLittleEndian ] )
+
+ ...
+ 9. Return RawBytesToNumber(type, rawValue, isLittleEndian).
+
+ 24.1.1.5 RawBytesToNumber( type, rawBytes, isLittleEndian )
+
+ ...
+ 2. If isLittleEndian is false, reverse the order of the elements of rawBytes.
+ ...
+features: [DataView, ArrayBuffer, DataView.prototype.setUint8, BigInt]
+---*/
+
+var buffer = new ArrayBuffer(16);
+var sample = new DataView(buffer, 0);
+
+sample.setUint8(0, 39);
+sample.setUint8(1, 2);
+sample.setUint8(2, 6);
+sample.setUint8(3, 2);
+sample.setUint8(4, 128);
+sample.setUint8(5, 0);
+sample.setUint8(6, 128);
+sample.setUint8(7, 1);
+sample.setUint8(8, 127);
+sample.setUint8(9, 0);
+sample.setUint8(10, 1);
+sample.setUint8(11, 2);
+sample.setUint8(12, 128);
+sample.setUint8(13, 127);
+sample.setUint8(14, 255);
+sample.setUint8(15, 128);
+
+sample = new DataView(buffer, 4);
+
+assert.sameValue(sample.getBigInt64(0, false), -9223231292940746494n, "0, false");
+assert.sameValue(sample.getBigInt64(1, false) , 36030441991504512n, "1, false");
+assert.sameValue(sample.getBigInt64(2, false) , -9222950923884396417n, "2, false");
+assert.sameValue(sample.getBigInt64(3, false) , 107804920417124351n, "3, false");
+assert.sameValue(sample.getBigInt64(4, false) , 9151315553074282368n, "4, false");
+
+assert.sameValue(sample.getBigInt64(0, true) , 144397208538579072n, "0, true");
+assert.sameValue(sample.getBigInt64(1, true) , -9222807985258921984n, "1, true");
+assert.sameValue(sample.getBigInt64(2, true) , 9187345443162358144n, "2, true");
+assert.sameValue(sample.getBigInt64(3, true) , -36169525900574975n, "3, true");
+assert.sameValue(sample.getBigInt64(4, true) , -9151455730027396993n, "4, true");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/return-values.js b/test/built-ins/DataView/prototype/getBigInt64/return-values.js
new file mode 100644
index 000000000..b07168a3b
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/return-values.js
@@ -0,0 +1,69 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Return values from Buffer
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 14. Let bufferIndex be getIndex + viewOffset.
+ 15. Return GetValueFromBuffer(buffer, bufferIndex, type, isLittleEndian).
+ ...
+
+ 24.1.1.6 GetValueFromBuffer ( arrayBuffer, byteIndex, type [ , isLittleEndian
+ ] )
+
+ ...
+ 8. If isLittleEndian is false, reverse the order of the elements of rawValue.
+ ...
+features: [DataView, ArrayBuffer, DataView.prototype.setUint8, BigInt]
+---*/
+
+var buffer = new ArrayBuffer(16);
+var sample = new DataView(buffer, 0);
+
+sample.setUint8(0, 39);
+sample.setUint8(1, 2);
+sample.setUint8(2, 6);
+sample.setUint8(3, 2);
+sample.setUint8(4, 128);
+sample.setUint8(5, 0);
+sample.setUint8(6, 128);
+sample.setUint8(7, 1);
+sample.setUint8(8, 127);
+sample.setUint8(9, 0);
+sample.setUint8(10, 1);
+sample.setUint8(11, 2);
+sample.setUint8(12, 128);
+sample.setUint8(13, 127);
+sample.setUint8(14, 255);
+sample.setUint8(15, 128);
+
+assert.sameValue(sample.getBigInt64(0, false), 2810815725239828481n, "0, false");
+assert.sameValue(sample.getBigInt64(1, false), 145806786723578239n, "1, false");
+assert.sameValue(sample.getBigInt64(2, false), 433049253816925952n, "2, false");
+assert.sameValue(sample.getBigInt64(3, false), 180144534875734017n, "3, false");
+assert.sameValue(sample.getBigInt64(4, false), -9223231292940746494n, "4, false");
+assert.sameValue(sample.getBigInt64(5, false), 36030441991504512n, "5, false");
+assert.sameValue(sample.getBigInt64(6, false), -9222950923884396417n, "6, false");
+assert.sameValue(sample.getBigInt64(7, false), 107804920417124351n, "7, false");
+assert.sameValue(sample.getBigInt64(8, false), 9151315553074282368n, "8, false");
+
+assert.sameValue(sample.getBigInt64(0, true), 108086940846653991n, "0, true");
+assert.sameValue(sample.getBigInt64(1, true), 9151736657429530114n, "1, true");
+assert.sameValue(sample.getBigInt64(2, true), 35748971318084102n, "2, true");
+assert.sameValue(sample.getBigInt64(3, true), 72197238457139202n, "3, true");
+assert.sameValue(sample.getBigInt64(4, true), 144397208538579072n, "4, true");
+assert.sameValue(sample.getBigInt64(5, true), -9222807985258921984n, "5, true");
+assert.sameValue(sample.getBigInt64(6, true), 9187345443162358144n, "6, true");
+assert.sameValue(sample.getBigInt64(7, true), -36169525900574975n, "7, true");
+assert.sameValue(sample.getBigInt64(8, true), -9151455730027396993n, "8, true");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/this-has-no-dataview-internal.js b/test/built-ins/DataView/prototype/getBigInt64/this-has-no-dataview-internal.js
new file mode 100644
index 000000000..582078cfe
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/this-has-no-dataview-internal.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Throws a TypeError if this does not have a [[DataView]] internal slot
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ 1. If Type(view) is not Object, throw a TypeError exception.
+ 2. If view does not have a [[DataView]] internal slot, throw a TypeError
+ exception.
+ ...
+features: [DataView, ArrayBuffer, Int8Array, BigInt, arrow-function]
+---*/
+
+var getBigInt64 = DataView.prototype.getBigInt64;
+
+assert.throws(TypeError, () => getBigInt64.call({}), "{}");
+
+assert.throws(TypeError, () => getBigInt64.call([]), "[]");
+
+var ab = new ArrayBuffer(1);
+assert.throws(TypeError, () => getBigInt64.call(ab), "ArrayBuffer");
+
+var ta = new Int8Array();
+assert.throws(TypeError, () => getBigInt64.call(ta), "TypedArray");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js b/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js
new file mode 100644
index 000000000..a4013540e
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/this-is-not-object.js
@@ -0,0 +1,37 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: Throws a TypeError if this is not Object
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ 1. If Type(view) is not Object, throw a TypeError exception.
+ ...
+features: [DataView, ArrayBuffer, Symbol, BigInt, arrow-function]
+---*/
+
+var getBigInt64 = DataView.prototype.getBigInt64;
+
+assert.throws(TypeError, () => getBigInt64.call(undefined),
+ "undefined");
+
+assert.throws(TypeError, () => getBigInt64.call(null), "null");
+
+assert.throws(TypeError, () => getBigInt64.call(1), "1");
+
+assert.throws(TypeError, () => getBigInt64.call("string"), "string");
+
+assert.throws(TypeError, () => getBigInt64.call(true), "true");
+
+assert.throws(TypeError, () => getBigInt64.call(false), "false");
+
+var s = Symbol("1");
+assert.throws(TypeError, () => getBigInt64.call(s), "symbol");
diff --git a/test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js b/test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js
new file mode 100644
index 000000000..e6df8cdd4
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/to-boolean-littleendian.js
@@ -0,0 +1,53 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ Boolean littleEndian argument coerced in ToBoolean
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 5. Set isLittleEndian to ToBoolean(isLittleEndian).
+ ...
+ 12. Let bufferIndex be getIndex + viewOffset.
+ 13. Return GetValueFromBuffer(buffer, bufferIndex, type, false,
+ "Unordered", isLittleEndian).
+
+ 24.1.1.6 GetValueFromBuffer ( arrayBuffer, byteIndex, type,
+ isTypedArray, order [ , isLittleEndian ] )
+
+ ...
+ 9. Return RawBytesToNumber(type, rawValue, isLittleEndian).
+
+ 24.1.1.5 RawBytesToNumber( type, rawBytes, isLittleEndian )
+
+ ...
+ 2. If isLittleEndian is false, reverse the order of the elements of rawBytes.
+ ...
+includes: [typeCoercion.js]
+features: [DataView, ArrayBuffer, DataView.prototype.setUint8, BigInt, Symbol, Symbol.toPrimitive]
+---*/
+
+var buffer = new ArrayBuffer(8);
+var sample = new DataView(buffer, 0);
+
+sample.setUint8(7, 255);
+
+// False
+assert.sameValue(sample.getBigInt64(0), 255n, "no argument");
+testCoercibleToBooleanFalse(function (x) {
+ assert.sameValue(sample.getBigInt64(0, x), 255n);
+});
+
+// True
+testCoercibleToBooleanTrue(function (x) {
+ assert.sameValue(sample.getBigInt64(0, x), -72057594037927936n);
+});
diff --git a/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js
new file mode 100644
index 000000000..06661b1e2
--- /dev/null
+++ b/test/built-ins/DataView/prototype/getBigInt64/toindex-byteoffset.js
@@ -0,0 +1,54 @@
+// Copyright (C) 2017 Robin Templeton. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-dataview.prototype.getbigint64
+description: >
+ ToIndex conversions on byteOffset
+info: |
+ DataView.prototype.getBigInt64 ( byteOffset [ , littleEndian ] )
+
+ 1. Let v be the this value.
+ 2. If littleEndian is not present, let littleEndian be undefined.
+ 3. Return ? GetViewValue(v, byteOffset, littleEndian, "Int64").
+
+ 24.3.1.1 GetViewValue ( view, requestIndex, isLittleEndian, type )
+
+ ...
+ 4. Let getIndex be ? ToIndex(requestIndex).
+ ...
+includes: [typeCoercion.js]
+features: [DataView, ArrayBuffer, DataView.prototype.setUint8, BigInt, Symbol, Symbol.toPrimitive]
+---*/
+
+var buffer = new ArrayBuffer(12);
+var sample = new DataView(buffer, 0);
+
+sample.setUint8(0, 39);
+sample.setUint8(1, 2);
+sample.setUint8(2, 6);
+sample.setUint8(3, 2);
+sample.setUint8(4, 128);
+sample.setUint8(5, 0);
+sample.setUint8(6, 128);
+sample.setUint8(7, 1);
+sample.setUint8(8, 127);
+sample.setUint8(9, 0);
+sample.setUint8(10, 1);
+sample.setUint8(11, 2);
+
+testCoercibleToIndexZero(function (x) {
+ assert.sameValue(sample.getBigInt64(x), 2810815725239828481n);
+});
+
+testCoercibleToIndexOne(function (x) {
+ assert.sameValue(sample.getBigInt64(x), 145806786723578239n);
+});
+
+testCoercibleToIndexFromIndex(2, function (x) {
+ assert.sameValue(sample.getBigInt64(x), 433049253816925952n);
+});
+
+testCoercibleToIndexFromIndex(3, function (x) {
+ assert.sameValue(sample.getBigInt64(x), 180144534875734017n);
+});