-
Notifications
You must be signed in to change notification settings - Fork 1
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
Normative: Report assignment failure to canonical numeric properties of immutable TypedArrays #29
Normative: Report assignment failure to canonical numeric properties of immutable TypedArrays #29
Conversation
…ng properties of immutable-backed TypedArray instances Note that this includes non-integer-index but still canonical numeric properties such as "-0", "-1", "1.2", and String(2**53) = "9007199254740992", but does not include non-canonical-numeric properties such as "1.20", "1e3", and "0x20". Ideally, TypedArrays would restrict special treatment of canonical numeric string properties to the strict subset that are integer indices (aligning with similar treatment in String), but that is out of scope for this commit.
The rendered spec for this PR is available at https://tc39.es/proposal-immutable-arraybuffer/pr/29. |
spec.emu
Outdated
<p>It performs the following steps when called:</p> | ||
<emu-alg> | ||
1. Let _target_ be the *this* value. | ||
1. <ins>NOTE: `Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~<ins>, ~write~</ins>).` here would observably change the observable calls into user code and thrown error when IsTypedArrayOutOfBounds returns *true* and _offset_ is negative. Such a change should be pursued.</ins> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the rendered form at https://tc39.es/proposal-immutable-arraybuffer/pr/29/#sec-%typedarray%.prototype.set I see
Is this a symptom of malformed markup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this would render properly?
1. <ins>NOTE: `Let _taRecord_ be ? ValidateTypedArray(_O_, ~seq-cst~<ins>, ~write~</ins>).` here would observably change the observable calls into user code and thrown error when IsTypedArrayOutOfBounds returns *true* and _offset_ is negative. Such a change should be pursued.</ins> | |
1. <ins>NOTE: `Let _taRecord_ be <del>? ValidateTypedArray(_O_, ~seq-cst~)</del><ins>? ValidateTypedArray(_O_, ~seq-cst~, ~write~)</ins>.` here would observably change the observable calls into user code and thrown error when IsTypedArrayOutOfBounds returns *true* and _offset_ is negative. Such a change should be pursued.</ins> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Note: I only looked at the renderings, not the sources they were generated from.
2fa7285
to
39c2484
Compare
Note that this includes non-integer-index but still canonical numeric properties such as "-0", "-1", "1.2", and String(2**53) = "9007199254740992", but does not include non-canonical-numeric properties such as "1.20", "1e3", and "0x20", which are not subject to special treatment and therefore can be set as on any ordinary object.
Ideally, TypedArrays would restrict special treatment of canonical numeric string properties to the strict subset that are integer indices (integers in the inclusive interval from 0 to 2**53 - 1), but that is out of scope for this PR.
The first two commits are separable editorial work, but kept in because they were performed over the course of the normative effort.