Project: aptanastudio
Issue APSTUD-4864: JS Type Inferencing fails to check local scope for variable type before checking globals
JS Type Inferencing will infer "self" here to be of type "Window" because we defined a Window.self global property in our metadata. When the type inferencing looks up the type of a property (self), it looks in the globals in the index, and if none are found then tries to infer the symbol. The logic likely should be reversed. In this case the self variable is defined in the local scope and we need to infer it's type there, rather than first consulting the Window.self property in the index. {code} var Utils = {	create: function() {	var self = {	chain: function() {	return self;	}	};	return self;	} }; var thing = Utils.create(); thing.chain(); {code}
Story points: 13