diff options
Diffstat (limited to 'test/built-ins/TypedArray/prototype/buffer')
10 files changed, 53 insertions, 8 deletions
diff --git a/test/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js b/test/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js new file mode 100644 index 000000000..3332f1a6c --- /dev/null +++ b/test/built-ins/TypedArray/prototype/buffer/BigInt/detached-buffer.js @@ -0,0 +1,21 @@ +// 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-get-%typedarray%.prototype.buffer +description: The getter method does not throw with a detached buffer +info: | + 22.2.3.1 get %TypedArray%.prototype.buffer + + ... + 4. Let buffer be the value of O's [[ViewedArrayBuffer]] internal slot. + 5. Return buffer. +includes: [testBigIntTypedArray.js, detachArrayBuffer.js] +features: [BigInt, TypedArray] +---*/ + +testWithBigIntTypedArrayConstructors(function(TA) { + var buffer = new ArrayBuffer(8); + var sample = new TA(buffer, 0, 1); + $DETACHBUFFER(sample.buffer); + assert.sameValue(sample.buffer, buffer); +}, [BigInt64Array, BigUint64Array]); diff --git a/test/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js b/test/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.js new file mode 100644 index 000000000..7630425eb --- /dev/null +++ b/test/built-ins/TypedArray/prototype/buffer/BigInt/return-buffer.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-get-%typedarray%.prototype.buffer +description: > + Return buffer from [[ViewedArrayBuffer]] internal slot +info: | + 22.2.3.1 get %TypedArray%.prototype.buffer + + ... + 4. Let buffer be the value of O's [[ViewedArrayBuffer]] internal slot. + 5. Return buffer. +includes: [testBigIntTypedArray.js] +features: [BigInt, TypedArray] +---*/ + +testWithBigIntTypedArrayConstructors(function(TA) { + var buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT); + var ta = new TA(buffer); + + assert.sameValue(ta.buffer, buffer); +}, [BigInt64Array, BigUint64Array]); diff --git a/test/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js b/test/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js index 46e9206a8..6c8241122 100644 --- a/test/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js +++ b/test/built-ins/TypedArray/prototype/buffer/invoked-as-accessor.js @@ -1,7 +1,7 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 22.2.3.1 +esid: sec-get-%typedarray%.prototype.buffer description: > Requires this value to have a [[ViewedArrayBuffer]] internal slot info: | diff --git a/test/built-ins/TypedArray/prototype/buffer/invoked-as-func.js b/test/built-ins/TypedArray/prototype/buffer/invoked-as-func.js index 249511110..d962e2d58 100644 --- a/test/built-ins/TypedArray/prototype/buffer/invoked-as-func.js +++ b/test/built-ins/TypedArray/prototype/buffer/invoked-as-func.js @@ -1,7 +1,7 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 22.2.3.1 +esid: sec-get-%typedarray%.prototype.buffer description: Throws a TypeError exception when invoked as a function info: | 22.2.3.1 get %TypedArray%.prototype.buffer diff --git a/test/built-ins/TypedArray/prototype/buffer/length.js b/test/built-ins/TypedArray/prototype/buffer/length.js index 72e488c11..1ddb20c4e 100644 --- a/test/built-ins/TypedArray/prototype/buffer/length.js +++ b/test/built-ins/TypedArray/prototype/buffer/length.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 22.2.3.1 +esid: sec-get-%typedarray%.prototype.buffer description: > get %TypedArray%.prototype.buffer.length is 0. info: | @@ -20,6 +20,7 @@ info: | object has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. includes: [propertyHelper.js, testTypedArray.js] +features: [TypedArray] ---*/ var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer"); diff --git a/test/built-ins/TypedArray/prototype/buffer/name.js b/test/built-ins/TypedArray/prototype/buffer/name.js index bbd1b6f37..d52454a7f 100644 --- a/test/built-ins/TypedArray/prototype/buffer/name.js +++ b/test/built-ins/TypedArray/prototype/buffer/name.js @@ -2,7 +2,7 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 22.2.3.1 +esid: sec-get-%typedarray%.prototype.buffer description: > get %TypedArray%.prototype.buffer.name is "get buffer". info: | @@ -17,6 +17,7 @@ info: | object, if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. includes: [propertyHelper.js, testTypedArray.js] +features: [TypedArray] ---*/ var desc = Object.getOwnPropertyDescriptor(TypedArray.prototype, "buffer"); diff --git a/test/built-ins/TypedArray/prototype/buffer/prop-desc.js b/test/built-ins/TypedArray/prototype/buffer/prop-desc.js index f666062a7..dee44b2fe 100644 --- a/test/built-ins/TypedArray/prototype/buffer/prop-desc.js +++ b/test/built-ins/TypedArray/prototype/buffer/prop-desc.js @@ -1,7 +1,7 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 22.2.3.1 +esid: sec-get-%typedarray%.prototype.buffer description: > "buffer" property of TypedArrayPrototype info: | @@ -11,6 +11,7 @@ info: | Section 17: Every accessor property described in clauses 18 through 26 and in Annex B.2 has the attributes {[[Enumerable]]: false, [[Configurable]]: true } includes: [propertyHelper.js, testTypedArray.js] +features: [TypedArray] ---*/ var TypedArrayPrototype = TypedArray.prototype; diff --git a/test/built-ins/TypedArray/prototype/buffer/return-buffer.js b/test/built-ins/TypedArray/prototype/buffer/return-buffer.js index 82420a6df..fe01f785b 100644 --- a/test/built-ins/TypedArray/prototype/buffer/return-buffer.js +++ b/test/built-ins/TypedArray/prototype/buffer/return-buffer.js @@ -1,7 +1,7 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 22.2.3.1 +esid: sec-get-%typedarray%.prototype.buffer description: > Return buffer from [[ViewedArrayBuffer]] internal slot info: | diff --git a/test/built-ins/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.js b/test/built-ins/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.js index 9b6b28db8..65dace14a 100644 --- a/test/built-ins/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.js +++ b/test/built-ins/TypedArray/prototype/buffer/this-has-no-typedarrayname-internal.js @@ -2,7 +2,6 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-get-%typedarray%.prototype.buffer -es6id: 22.2.3.1 description: > Throws a TypeError exception when `this` does not have a [[TypedArrayName]] internal slot diff --git a/test/built-ins/TypedArray/prototype/buffer/this-is-not-object.js b/test/built-ins/TypedArray/prototype/buffer/this-is-not-object.js index 0292bd502..29a455566 100644 --- a/test/built-ins/TypedArray/prototype/buffer/this-is-not-object.js +++ b/test/built-ins/TypedArray/prototype/buffer/this-is-not-object.js @@ -1,7 +1,7 @@ // Copyright (C) 2016 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- -es6id: 22.2.3.1 +esid: sec-get-%typedarray%.prototype.buffer description: Throws a TypeError exception when `this` is not Object info: | 22.2.3.1 get %TypedArray%.prototype.buffer |