Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e52386
Try to avoid "Argument list too long" when many files are changed
gibson042 Jul 23, 2025
9ddc77e
Remove unused parameter from testWith*TypedArrayConstructors callbacks
gibson042 Jul 21, 2025
f01eb9f
Merge harness/testBigIntTypedArray.js into harness/testTypedArray.js
gibson042 Jul 21, 2025
7da66e0
Replace includes of harness/testBigIntTypedArray.js
gibson042 Jul 21, 2025
cd179fb
Generalize testWithTypedArrayConstructors to invoke its callback with…
gibson042 Jul 22, 2025
4f3ed60
Make use of the argument factory provided by testWithTypedArrayConstr…
gibson042 Jul 21, 2025
7aa51fb
Clean up tests broken by use of the TypedArray constructor argument f…
gibson042 Jul 22, 2025
3b45d8f
Remove unnecessary constructor argument factory restriction in TypedA…
gibson042 Jul 22, 2025
2dae60b
Conditionally support bigint TypedArray constructors in harness/testT…
gibson042 Jul 23, 2025
4099271
[immutable-arraybuffer] Include immutable ArrayBuffers in TypedArray …
gibson042 Jul 22, 2025
bcb0f2a
Skip immutable ArrayBuffers in TypedArray.{from,of} tests
gibson042 Jul 21, 2025
c5eea26
Remove unnecessary mutation in TypedArray method tests
gibson042 Jul 22, 2025
9af9c7c
Skip immutable ArrayBuffers in tests of TypedArray methods that mutat…
gibson042 Jul 21, 2025
5aa7097
Skip immutable ArrayBuffers in more mutation-dependent tests
gibson042 Jul 22, 2025
7e0ee2a
Skip immutable ArrayBuffers in TypedArray Set/DefineOwnProperty tests
gibson042 Jul 22, 2025
69de3a0
Increase TypedArray/ArrayBuffer coverage for ArrayBuffer.isView
gibson042 Jul 24, 2025
6afaaa0
Increase TypedArray/ArrayBuffer coverage for ArrayIteratorPrototype
gibson042 Jul 24, 2025
94c4b3d
Increase TypedArray/ArrayBuffer coverage for Atomics
gibson042 Jul 24, 2025
9509fe3
Increase coverage for TypedArray [[DefineOwnProperty]]
gibson042 Jul 27, 2025
1957be1
Increase coverage for TypedArray [[Delete]]
gibson042 Jul 27, 2025
9b0009c
Increase coverage for TypedArray [[Get]]
gibson042 Jul 27, 2025
2b74ee6
Increase coverage for TypedArray [[GetOwnProperty]]
gibson042 Jul 27, 2025
67ec3f1
Increase coverage for TypedArray [[HasProperty]]
gibson042 Jul 27, 2025
a52f22b
Increase coverage for TypedArray [[OwnPropertyKeys]]
gibson042 Jul 27, 2025
5aa89fb
Increase coverage for TypedArray [[Set]]
gibson042 Jul 27, 2025
d6bdfb6
Fix applicability of TypedArray internal operation tests
gibson042 Jul 29, 2025
bc7d92b
[immutable-arraybuffer] TypedArray canonical numeric index string pro…
gibson042 Jul 26, 2025
01675ce
[immutable-arraybuffer] TypedArray canonical in-bounds index properti…
gibson042 Jul 26, 2025
795f516
[immutable-arraybuffer] TypedArray canonical in-bounds index properti…
gibson042 Jul 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright (C) 2025 Richard Gibson. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-typedarray-getownproperty
description: >
When the backing buffer is immutable, properties for in-bounds indexes are
associated with non-configurable non-writable descriptors.
info: |
[[GetOwnProperty]] ( P )
1. If P is a String, then
a. Let numericIndex be CanonicalNumericIndexString(P).
b. If numericIndex is not undefined, then
i. Let value be TypedArrayGetElement(O, numericIndex).
ii. If value is undefined, return undefined.
iii. Let mutable be true.
iv. If IsImmutableBuffer(O.[[ViewedArrayBuffer]]) is true, set mutable to false.
v. Return the PropertyDescriptor { [[Value]]: value, [[Writable]]: true mutable,
[[Enumerable]]: true, [[Configurable]]: true mutable }.
features: [TypedArray, immutable-arraybuffer]
includes: [testTypedArray.js, compareArray.js, propertyHelper.js]
---*/

testWithAllTypedArrayConstructors(function(TA, makeCtorArg) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other tests in the same directory do not test BigInt typed arrays i.e. use testWithTypedArrayConstructors instead of testWithAllTypedArrayConstructors (and contain a variant with testWithBigIntTypedArrayConstructors in BigInt sub-directory).

var sample = new TA(makeCtorArg(["42", "43"]));

var value0 = sample[0];
var value1 = sample[1];
assert.compareArray([String(value0), String(value1)], ["42", "43"]);

verifyProperty(sample, "0", {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that verifyProperty() is based on various assumptions that don't work for typed arrays. For example, isWritable(new Uint8Array(8), "0") is false (incorrectly) and isWritable(new BigInt64Array(8), "0") even results in SyntaxError: Cannot convert unlikelyValue to a BigInt.

The current version of the test seems to be lucky to pass despite the usage of verifyProperty(), but it is probably better to avoid it (for typed arrays). Note that, for example, index-prop-desc.js that is kind of mutable version of this test avoids verifyProperty() for the mentioned reasons.

value: value0,
configurable: false,
enumerable: true,
writable: false
});
verifyProperty(sample, "1", {
value: value1,
configurable: false,
enumerable: true,
writable: false
});
}, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ testWithTypedArrayConstructors(function(TA, makeCtorArg) {
assert.sameValue(descriptor1.configurable, true);
assert.sameValue(descriptor1.enumerable, true);
assert.sameValue(descriptor1.writable, true);
});
}, null, null, ["immutable"]);