tc39 / tc39/proposal-immutable-arraybuffer

Order of operations, when to throw or silently do nothing?

未关闭
#16 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
JavaScript
星标
38
派生
7
PR 合并指标
30 天内没有已合并 PR

描述

  • Should sliceToImmutable with reversed start and end throw an exception even though slice with the same arguments would not?

  • Should trying to write data in an immutable ArrayBuffer via a TypedArray element set throw, even though trying to write out-of-bounds or to a detached ArrayBuffer does not?

  • Should TypedArray write methods (copyWithin, fill, reverse, set, etc.) throw when their backing ArrayBuffer is immutable but the targeted range is zero-length? If so, how early or late in the algorithm? The methods currently inspect arguments after ValidateTypedArray.

Similarly,

  • How early or late in SetViewValue against an immutable ArrayBuffer should an exception be thrown? It currently inspects arguments before IsViewOutOfBounds.

  • Likewise for abstract operations such as ArrayBufferCopyAndDetach (which currently checks IsSharedArrayBuffer, then newLength, then IsDetachedBuffer).

  • And also for Atomics functions.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

检查列出的操作——sliceToImmutable、TypedArray write methods、SetViewValue、ArrayBufferCopyAndDetach 和 Atomics——并比较它们当前的验证顺序。只有在提案解决了不可变缓冲区错误应相对于参数、边界、分离和零长度检查何时发生之后,该 issue 才算完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
backend-api-design
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
20/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。