ESNext.SharedMemory still declares the removed Atomics.pause parameter

未关闭 适合新手
#65,339 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@JemmyIndex 已经在做这个了。

开始于 2026年11月6日。

  • #65352 来自 @JemmyIndex —— 未关闭

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
88/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
backend

调研方向

在 tsc/internal/bundled/libs/lib.esnext.sharedmemory.d.ts 中找到 Atomics.pause 的声明。移除它的可选参数,然后使用两个示例调用运行 issue 中的复现命令;Atomics.pause() 应能编译通过,而 Atomics.pause(1.5) 应产生 TS2554。

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

描述

⚙ Compilation target

ES5

⚙ Library

es2026,esnext.sharedmemory

Missing / Incorrect Definition

I came across a minor mismatch in the bundled declaration while checking the TypeScript 7.1 beta.

lib.esnext.sharedmemory.d.ts declares Atomics.pause(n?: number): void. The ECMAScript draft defines Atomics.pause() with no parameters.

Reproduced with TypeScript 7.1.0-beta and 7.1.0-dev.20261105.1. The command below accepts both calls without diagnostics. The first call should compile, and the second should report TS2554.

To reproduce locally, save the sample as repro.ts in an empty directory and run the following command there.

npx --yes [email protected] tsc --noEmit --strict --lib es2026,esnext.sharedmemory repro.ts

In the bundled declaration, remove the optional parameter.

-    pause(n?: number): void;
+    pause(): void;

With only that line changed in a temporary install of the nightly, the same command reports the following diagnostic. With only the first call in the file, the patched compiler exits successfully without diagnostics.

repro.ts(2,15): error TS2554: Expected 0 arguments, but got 1.
Sample Code
Atomics.pause()
Atomics.pause(1.5)
Documentation Link

If you confirm this issue I can create a PR with the fix.

主要语言
Go
星标
112k
派生
15.4k
平均合并
3 天 2 小时
30 天内合并 PR
149

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

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

microsoft/TypeScript 的其他 Issue

查看 microsoft/TypeScript 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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