blob: 2b418f61166cfd8ef8aee3442db4a12b2f1d3637 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-integer-indexed-exotic-objects-getownproperty-p
description: Test for-in enumeration with detached buffer.
info: |
9.4.5.1 [[GetOwnProperty]] ( P )
...
3. If Type(P) is String, then
a. Let numericIndex be ! CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Let value be ! IntegerIndexedElementGet(O, numericIndex).
...
IntegerIndexedElementGet ( O, index )
...
Let buffer be O.[[ViewedArrayBuffer]].
If IsDetachedBuffer(buffer) is true, return undefined.
...
13.7.5.15 EnumerateObjectProperties (O)
...
EnumerateObjectProperties must obtain the own property keys of the
target object by calling its [[OwnPropertyKeys]] internal method.
Property attributes of the target object must be obtained by
calling its [[GetOwnProperty]] internal method.
includes: [testTypedArray.js, detachArrayBuffer.js]
features: [align-detached-buffer-semantics-with-web-reality, TypedArray]
---*/
testWithTypedArrayConstructors(function(TA) {
var sample = new TA(42);
$DETACHBUFFER(sample.buffer);
let count = 0;
for (var key in sample) {
count++;
}
assert.sameValue(count, 0, 'The value of `count` is 0');
});
reportCompare(0, 0);
|