Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / TypedArrayConstructors / internals / HasProperty / BigInt / detached-buffer-realm.js
blob298c79428bddfbafcea4cae7a7e9a01d7f12d0f2
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   Returns false if this has a detached buffer (honoring the Realm of the
7   current execution context)
8 info: |
9   9.4.5.2 [[HasProperty]](P)
11   ...
12   3. If Type(P) is String, then
13     a. Let numericIndex be ! CanonicalNumericIndexString(P).
14     b. If numericIndex is not undefined, then
15       i. Let buffer be O.[[ViewedArrayBuffer]].
16       ii. If IsDetachedBuffer(buffer) is true, return false.
17   ...
18 includes: [testBigIntTypedArray.js, detachArrayBuffer.js]
19 features: [align-detached-buffer-semantics-with-web-reality, BigInt, cross-realm, Reflect, TypedArray]
20 ---*/
22 var other = $262.createRealm().global;
24 testWithBigIntTypedArrayConstructors(function(TA) {
25   var OtherTA = other[TA.name];
26   var sample = new OtherTA(1);
28   $DETACHBUFFER(sample.buffer);
30   assert.sameValue(Reflect.has(sample, '0'), false, 'Reflect.has(sample, "0") must return false');
31 });
33 reportCompare(0, 0);