Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / TypedArray / prototype / at / index-non-numeric-argument-tointeger-invalid.js
blobe3f65c143d694933585a162d94f8498a7778f8b0
1 // Copyright (C) 2020 Rick Waldron. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-%typedarray%.prototype.at
5 description: >
6   Property type and descriptor.
7 info: |
8   %TypedArray%.prototype.at( index )
10   Let relativeIndex be ? ToInteger(index).
12 includes: [testTypedArray.js]
13 features: [TypedArray, TypedArray.prototype.at]
14 ---*/
15 assert.sameValue(
16   typeof TypedArray.prototype.at,
17   'function',
18   'The value of `typeof TypedArray.prototype.at` is "function"'
21 testWithTypedArrayConstructors(TA => {
22   assert.sameValue(typeof TA.prototype.at, 'function', 'The value of `typeof TA.prototype.at` is "function"');
23   let a = new TA([0,1,2,3]);
25   assert.throws(TypeError, () => {
26     a.at(Symbol());
27   }, '`a.at(Symbol())` throws TypeError');
28 });
30 reportCompare(0, 0);