| Summary: | Parser log message when invoking a constructor returned from a function call (occurs in Sencha Touch) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Paul Beusterien <paul.beusterien> | ||||
| Component: | General | Assignee: | Chris Jaun <cmjaun> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Nitin Dahyabhai <thatnitind> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | cmjaun | ||||
| Version: | 3.2.3 | Flags: | thatnitind:
review+
|
||||
| Target Milestone: | 3.2.4 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Paul Beusterien
Here's more of a real program to illustrate the bug:
function xxx() {
return function myConstructor(v) { this.val = v; };
}
function testNew() {
var rectangleConstructor = xxx();
var r = new rectangleConstructor(99);
alert ("value is " + r.val );
var r2 = new (xxx())(99); // should be same behavior as above
alert ("value is " + r2.val );
};
Created attachment 187449 [details]
One-line Fix for 333387
I've attached a patch with a fix.
It's not clear to me what the purpose of the switch statement in the resolveForAllocation method in Expression.java is. Why isn't it the same as the resolveForAllocation method in FunctionExpression.java.
In any case, the switch expression should include IASTNode.FUNCTION_CALL
Patch looks good...should be able to get this in 3.2.4. Checked into 3.2.4 and HEAD. |