-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JS EmitThe issue relates to the emission of JavaScriptThe issue relates to the emission of JavaScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-repros
Milestone
Description
π Search Terms
ES5, this alias
π Version & Regression Information
- This changed between versions 5.1.6 and 5.2.2
β― Playground Link
π» Code
// @target: es5
// @showEmit: true
class Wrapper {
constructor(
validate = (unsafe: {}) => this.validate(unsafe)) {
validate({});
}
private validate(typeUnsafe: any): boolean {
return true;
}
}
new Wrapper();
Target: ES5
π Actual behavior
Cannot read properties of undefined (reading 'validate')
π Expected behavior
No error (as with untranspiled version or with TS5.1.6)
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JS EmitThe issue relates to the emission of JavaScriptThe issue relates to the emission of JavaScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-repros