From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../GetOwnProperty/enumerate-detached-buffer.js | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js (limited to 'js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js') diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js new file mode 100644 index 0000000000..8611cfb434 --- /dev/null +++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/GetOwnProperty/enumerate-detached-buffer.js @@ -0,0 +1,44 @@ +// 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); -- cgit v1.2.3