Skip to content

Editorial: Make better use of ValidateTypedArray #3634

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Editorial: Refactor ValidateIntegerTypedArray on top of IsNoTearConfi…
…guration
  • Loading branch information
gibson042 committed Jul 1, 2025
commit f13976d6920e4f338715301d23d277f06b49a0be
7 changes: 3 additions & 4 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -45889,13 +45889,12 @@ <h1>
<dl class="header">
</dl>
<emu-alg>
1. Let _taRecord_ be ? ValidateTypedArray(_typedArray_, ~unordered~).
1. NOTE: Bounds checking is not a synchronizing operation when _typedArray_'s backing buffer is a growable SharedArrayBuffer.
1. Let _taRecord_ be ? ValidateTypedArray(_typedArray_, ~unordered~).
1. If _waitable_ is *true*, then
1. If _typedArray_.[[TypedArrayName]] is neither *"Int32Array"* nor *"BigInt64Array"*, throw a *TypeError* exception.
1. Else,
1. Let _type_ be TypedArrayElementType(_typedArray_).
1. If IsUnclampedIntegerElementType(_type_) is *false* and IsBigIntElementType(_type_) is *false*, throw a *TypeError* exception.
1. Let _type_ be TypedArrayElementType(_typedArray_).
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the else guard? There's no reason to do this check when _waitable_ is *true*, since it is implied by the checks in that branch.

1. If IsNoTearConfiguration(_type_, ~seq-cst~) is *false*, throw a *TypeError* exception.
1. Return _taRecord_.
</emu-alg>
</emu-clause>
Expand Down