- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed
Labels
Domain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-reprosIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 3.9.7
Search Terms:
this, alias
Code
// @filename: a.js
var libObjects = {}
libObjects.dataService = function (url) {
	var scope = this;
	/**
	 * updates some data
	 */
	scope.updateData = function () {
		//...
	}
	/**
	 * stop all processing
	 */
	scope.disable = function () {
		//...
	}
}
// @filename: b.js
var service = new libObjects.dataService("");
service
//   ^?Expected behavior:
service: dataService and should offer updateData and disable in completion.
Actual behavior:
service: any
Playground Link: Workbench Repro
Related Issues: 
#36618
Metadata
Metadata
Assignees
Labels
Domain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specificallyHas ReproThis issue has compiler-backed repros: https://aka.ms/ts-reprosThis issue has compiler-backed repros: https://aka.ms/ts-reprosIn DiscussionNot yet reached consensusNot yet reached consensusSuggestionAn idea for TypeScriptAn idea for TypeScript