From 837def66ac1700ce398df4a3b4eaeea915aa1df5 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 27 Mar 2024 17:44:35 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Ioanna M Dimitriou H <9728696+ioannad@users.noreply.github.com> --- .../TypedArray/from/from-array-mapper-detaches-result.js | 2 +- .../from/from-array-mapper-makes-result-out-of-bounds.js | 2 +- .../from-typedarray-into-itself-mapper-detaches-result.js | 2 +- ...darray-into-itself-mapper-makes-result-out-of-bounds.js | 2 +- .../from/from-typedarray-mapper-detaches-result.js | 2 +- .../from-typedarray-mapper-makes-result-out-of-bounds.js | 2 +- .../subarray/result-byteOffset-from-out-of-bounds.js | 2 +- .../with/index-validated-against-current-length.js | 7 ++++++- 8 files changed, 13 insertions(+), 8 deletions(-) diff --git a/test/built-ins/TypedArray/from/from-array-mapper-detaches-result.js b/test/built-ins/TypedArray/from/from-array-mapper-detaches-result.js index 2a7ee9733a0..c5f4632e9d1 100644 --- a/test/built-ins/TypedArray/from/from-array-mapper-detaches-result.js +++ b/test/built-ins/TypedArray/from/from-array-mapper-detaches-result.js @@ -4,7 +4,7 @@ /*--- esid: sec-%typedarray%.from description: > - Mapper function detaches result typed array. + If the mapper function detaches the result typed array, .from performs Set operation which ignores out-of-bounds indices. info: | %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) diff --git a/test/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js b/test/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js index 1e984f3ca72..56b9d558be8 100644 --- a/test/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js +++ b/test/built-ins/TypedArray/from/from-array-mapper-makes-result-out-of-bounds.js @@ -4,7 +4,7 @@ /*--- esid: sec-%typedarray%.from description: > - Mapper function makes result typed array out-of-bounds. + If the mapper function makes result typed array out-of-bounds, .from performs Set operation which ignores out-of-bounds indices. info: | %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) diff --git a/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js b/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js index b32641cc8b4..ca031bf3eec 100644 --- a/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js +++ b/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-detaches-result.js @@ -4,7 +4,7 @@ /*--- esid: sec-%typedarray%.from description: > - Mapper function detaches result typed array. + If the mapper function detaches the result typed array, .from performs Set operation which ignores out-of-bounds indices. info: | %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) diff --git a/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js b/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js index b740d673d60..d79899f7417 100644 --- a/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js +++ b/test/built-ins/TypedArray/from/from-typedarray-into-itself-mapper-makes-result-out-of-bounds.js @@ -4,7 +4,7 @@ /*--- esid: sec-%typedarray%.from description: > - Mapper function makes result typed array out-of-bounds. + If the mapper function makes result typed array out-of-bounds, .from performs Set operation which ignores out-of-bounds indices. info: | %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) diff --git a/test/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js b/test/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js index 10aa83400ad..d9f8b3d5fd1 100644 --- a/test/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js +++ b/test/built-ins/TypedArray/from/from-typedarray-mapper-detaches-result.js @@ -4,7 +4,7 @@ /*--- esid: sec-%typedarray%.from description: > - Mapper function detaches result typed array. + If the mapper function detaches the result typed array, .from performs Set operation which ignores out-of-bounds indices. info: | %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) diff --git a/test/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js b/test/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js index d88718bfb36..c863b2eb9ee 100644 --- a/test/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js +++ b/test/built-ins/TypedArray/from/from-typedarray-mapper-makes-result-out-of-bounds.js @@ -4,7 +4,7 @@ /*--- esid: sec-%typedarray%.from description: > - Mapper function makes result typed array out-of-bounds. + If the mapper function makes result typed array out-of-bounds, .from performs Set operation which ignores out-of-bounds indices. info: | %TypedArray%.from ( source [ , mapfn [ , thisArg ] ] ) diff --git a/test/built-ins/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js b/test/built-ins/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js index 72434b2d131..dc9bf7e80f3 100644 --- a/test/built-ins/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js +++ b/test/built-ins/TypedArray/prototype/subarray/result-byteOffset-from-out-of-bounds.js @@ -4,7 +4,7 @@ /*--- esid: sec-%typedarray%.prototype.subarray description: > - Result has correct the byteOffset when input is initially out-of-bounds. + Result has the correct byteOffset when input is initially out-of-bounds. info: | %TypedArray%.prototype.subarray ( start, end ) diff --git a/test/built-ins/TypedArray/prototype/with/index-validated-against-current-length.js b/test/built-ins/TypedArray/prototype/with/index-validated-against-current-length.js index e0fe8f12043..3bdbd3a7165 100644 --- a/test/built-ins/TypedArray/prototype/with/index-validated-against-current-length.js +++ b/test/built-ins/TypedArray/prototype/with/index-validated-against-current-length.js @@ -8,10 +8,15 @@ description: > info: | %TypedArray%.prototype.with ( index, value ) + 1. Let O be the this value. + 2. Let taRecord be ? ValidateTypedArray(O, SEQ-CST). + 3. Let len be TypedArrayLength(taRecord). ... 8. Else, let numericValue be ? ToNumber(value). - 9. If IsValidIntegerIndex(O, 𝔽(actualIndex)) is false, throw a RangeError exception. ... + 10. Let A be ? TypedArrayCreateSameType(O, « 𝔽(len) »). + ... + 13. Return A. features: [TypedArray, resizable-arraybuffer] ---*/