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.
4 esid: sec-integer-indexed-exotic-objects-hasproperty-p
5 description: Return abrupt from OrdinaryHasProperty parent's [[HasProperty]]
7 9.4.5.2 [[HasProperty]](P)
10 3. If Type(P) is String, then
11 a. Let numericIndex be ! CanonicalNumericIndexString(P).
12 b. If numericIndex is not undefined, then
13 i. Let buffer be O.[[ViewedArrayBuffer]].
14 ii. If IsDetachedBuffer(buffer) is true, return false.
17 9.1.7.1 OrdinaryHasProperty (O, P)
20 2. Let hasOwn be ? O.[[GetOwnProperty]](P).
21 3. If hasOwn is not undefined, return true.
22 4. Let parent be ? O.[[GetPrototypeOf]]().
23 5. If parent is not null, then
24 a. Return ? parent.[[HasProperty]](P).
26 includes: [testBigIntTypedArray.js]
27 features: [align-detached-buffer-semantics-with-web-reality, BigInt, Reflect, Proxy, TypedArray]
32 throw new Test262Error();
36 var proxy = new Proxy(TypedArray.prototype, handler);
38 testWithBigIntTypedArrayConstructors(function(TA) {
39 var sample = new TA(1);
41 Object.setPrototypeOf(sample, proxy);
44 Reflect.has(sample, 0), true,
45 'Reflect.has(sample, 0) must return true'
48 Reflect.has(sample, 1), false,
49 'Reflect.has(sample, 1) must return false'
52 assert.throws(Test262Error, function() {
53 Reflect.has(sample, "foo");
56 Object.defineProperty(sample, "foo", { value: 42 });
59 Reflect.has(sample, "foo"),
61 'Reflect.has(sample, "foo") must return true'