Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / TypedArrayConstructors / internals / HasProperty / BigInt / indexed-value.js
blob6773bd1487daf745c390ebf13b21fa519bb77bdd
1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 esid: sec-integer-indexed-exotic-objects-hasproperty-p
5 description: >
6   Return true for indexed properties
7 info: |
8   9.4.5.2 [[HasProperty]](P)
10   ...
11   3. If Type(P) is String, then
12     a. Let numericIndex be ! CanonicalNumericIndexString(P).
13     b. If numericIndex is not undefined, then
14       i. Let buffer be O.[[ViewedArrayBuffer]].
15       ii. If IsDetachedBuffer(buffer) is true, return false.
16       iii. If ! IsValidIntegerIndex(O, numericIndex) is false, return false.
17       iv. Return true.
18   ...
19 includes: [testBigIntTypedArray.js]
20 features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, TypedArray]
21 ---*/
22 testWithBigIntTypedArrayConstructors(function(TA) {
23   var sample = new TA([42n, 43n]);
24   assert.sameValue(Reflect.has(sample, 0), true, 'Reflect.has(sample, 0) must return true');
25   assert.sameValue(Reflect.has(sample, 1), true, 'Reflect.has(sample, 1) must return true');
26 });
28 reportCompare(0, 0);