microsoft / microsoft/TypeScript
Should not allow `import.defer?.('x')`
还没有人认领这个 Issue。
- 主要语言
- Go
- 星标
- 111k
- 派生
- 14.3k
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 132
描述
### 🔎 Search Terms
"import defer"
### 🕗 Version & Regression Information
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about __6.0.3_______
- I was unable to test this on prior versions because _______
### ⏯ Playground Link
https://www.typescriptlang.org/play/?moduleResolution=99&target=99&ssl=3&ssc=40&pln=2&pc=1#code/JYWwDg9gTgLgBPAZlCI4HIYE8wFMDOAxlMGDOgNwBQVhEAdvvGHALxyiSwB0AJrolxQA-NwAUmHAWKlyASgpA
### 💻 Code
```ts
import.defer?.('x');
```
### 🙁 Actual behavior
No errors.
### 🙂 Expected behavior
Should not allow it as an optional call.
### Additional information about the issue
Parsers like Oxc, Yuku, SWC, Babel all reject it. I didn't read the spec, but unless they are wrong.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从提供的 TypeScript Playground 链接和 `import.defer?.('x')` 示例开始,复现 parser 的行为。跟踪 import-defer 语法的 parser 入口点,并将其处理方式与 Oxc、Yuku、SWC 和 Babel 报告的拒绝行为进行比较。完成标准是这段代码被拒绝,而不是被接受为可选调用,并且有一个覆盖该情况的回归测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- typescript
- 领域
- compilers
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 70/100