| Summary: | Function literal with attributes assigned using "this." is not inferred as a type like regular functions are | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Chris Jaun <cmjaun> | ||||
| Component: | General | Assignee: | Chris Jaun <cmjaun> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Nitin Dahyabhai <thatnitind> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | Flags: | thatnitind:
review+
|
||||
| Version: | 3.2.2 | ||||||
| Target Milestone: | 3.2.3 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 182719 [details]
patch
Patch stores a potential function name in the AbstractMethodDeclaration object if one can be determined during the inference step. If it is determined that the function has no selector and one is needed then the potential name is returned if one exists. Checked into 3.2.3 and HEAD. |
I have a function in a JS file: var mortCal = function (homeCost, downPayment, interestRate, term) { this.homeCost = homeCost; this.downPayment = downPayment; this.interestRate = interestRate; this.term = term; }; I try to do: var mc = new mort* I attempt content assist where the * is. I would expect to see my inferred type mortCal as a proposal, but I do not. If I change the function to the following then it works correctly: function mortCal(homeCost, downPayment, interestRate, term) { this.homeCost = homeCost; this.downPayment = downPayment; this.interestRate = interestRate; this.term = term; };