diff options
Diffstat (limited to 'test/built-ins/TypedArrays/internals/Get/BigInt/indexed-value-sab.js')
-rw-r--r-- | test/built-ins/TypedArrays/internals/Get/BigInt/indexed-value-sab.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/built-ins/TypedArrays/internals/Get/BigInt/indexed-value-sab.js b/test/built-ins/TypedArrays/internals/Get/BigInt/indexed-value-sab.js new file mode 100644 index 000000000..b599b430c --- /dev/null +++ b/test/built-ins/TypedArrays/internals/Get/BigInt/indexed-value-sab.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// Copyright (C) 2017 Mozilla Corporation. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +esid: sec-integer-indexed-exotic-objects-get-p-receiver +description: > + Return value from valid numeric index, with SharedArrayBuffer +includes: [testBigIntTypedArray.js] +features: [BigInt, TypedArray, SharedArrayBuffer] +---*/ + +var proto = TypedArray.prototype; +var throwDesc = { + get: function() { + throw new Test262Error("OrdinaryGet was called! Ref: 9.1.8.1 3.c"); + } +}; +Object.defineProperty(proto, "0", throwDesc); +Object.defineProperty(proto, "1", throwDesc); + +testWithBigIntTypedArrayConstructors(function(TA) { + var sab = new SharedArrayBuffer(TA.BYTES_PER_ELEMENT * 2); + var sample = new TA(sab); + sample.set([convertToBigInt(42), convertToBigInt(1)]); + + assert.sameValue(sample["0"], convertToBigInt(42)); + assert.sameValue(sample["1"], convertToBigInt(1)); +}); |