microsoft / microsoft/TypeScript
Global 'this' capture logic is slightly wrong in `--noImplicitThis`
Offen
@DanielRosenwasser arbeitet bereits daran.
Seit 21.1.2026.
Needs Investigation
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
// @strict: true
function f(this: typeof globalThis) {
return () => this;
}
Expected: no error
Actual:
The containing arrow function captures the global value of 'this'.
I think we just need to add an isSourceFile(container) check or something.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.