summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js')
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js43
1 files changed, 43 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js
new file mode 100644
index 0000000000..00532ce8b2
--- /dev/null
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js
@@ -0,0 +1,43 @@
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-integer-indexed-exotic-objects-ownpropertykeys
+description: >
+ Return integer index + non numeric string keys
+info: |
+ 9.4.5.6 [[OwnPropertyKeys]] ()
+
+ ...
+ 3. Let len be the value of O's [[ArrayLength]] internal slot.
+ 4. For each integer i starting with 0 such that i < len, in ascending order,
+ a. Add ! ToString(i) as the last element of keys.
+ ...
+includes: [testTypedArray.js, compareArray.js]
+features: [Reflect, TypedArray]
+---*/
+
+TypedArray.prototype[3] = 42;
+TypedArray.prototype.bar = 42;
+
+testWithTypedArrayConstructors(function(TA) {
+ var sample1 = new TA([42, 42, 42]);
+ sample1.test262 = 42;
+ sample1.ecma262 = 42;
+ var result1 = Reflect.ownKeys(sample1);
+ assert(
+ compareArray(result1, ["0", "1", "2", "test262", "ecma262"]),
+ "result1"
+ );
+
+ var sample2 = new TA(4).subarray(2);
+ sample2.test262 = 42;
+ sample2.ecma262 = 42;
+ var result2 = Reflect.ownKeys(sample2);
+ assert(
+ compareArray(result2, ["0", "1", "test262", "ecma262"]),
+ "result2"
+ );
+});
+
+reportCompare(0, 0);