Bug 251206 - Parsing error when JSDoc parsing is deactivated
Summary: Parsing error when JSDoc parsing is deactivated
Status: CLOSED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.0.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0.5   Edit
Assignee: Chris Jaun CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-10-17 08:20 EDT by Klaus Reimer CLA
Modified: 2010-03-03 11:16 EST (History)
1 user (show)

See Also:
thatnitind: review+


Attachments
Updates the system.js library file (26.51 KB, patch)
2009-04-14 16:32 EDT, Chris Jaun CLA
thatnitind: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Reimer CLA 2008-10-17 08:20:35 EDT
Build ID: M20080911-1700

Steps To Reproduce:
1. Create JavaScript project and put the shown JavaScript code in a file.
2. Note that there is NO JsDoc stuff in it.
3. Note that the editor shows the error "The operator + is undefined for the argument type(s) void, String" when JsDoc parsing is deactivated in the configuration. If it is enabled then no error is shown.

Looks to me as if some parsing stuff which has nothing to do with JsDoc is also deactivated when JsDoc parsing is deactivated.


Demo source:


function Person(firstName, lastName)
{
	this.firstName = firstName;
	this.lastName = lastName;
}

Person.prototype.getFullName = function()
{
	return this.firstName + " " + this.lastName;
};

function NickPerson(firstName, lastName, nickName)
{
	Person.call(this, firstName, lastName);
	this.nickName = nickName;
}
NickPerson.prototype = new Person();

NickPerson.prototype.getFullName = function()
{
	return Person.prototype.getFullName.call(this) + " (" + this.nickName + ")";
};
Comment 1 Chris Jaun CLA 2009-04-14 16:32:36 EDT
Created attachment 131843 [details]
Updates the system.js library file
Comment 2 Chris Jaun CLA 2009-04-14 16:37:33 EDT
I added the return types into the function definitions in the system.js file.

Some functions in there, including the call() function, only had their return types defined in the JSdoc.

When JSdoc parsing was turned off the editor was unable to determine the return type so it assumed the type of the object was a "void" type.

The inference engine probably should try harder to figure out the return type when jsdoc parsing is off, but this fix should handle most cases.

Nitin, this can be fixed in 3.0.5 and 3.1.
Comment 3 Nitin Dahyabhai CLA 2009-04-14 17:59:50 EDT
Applied, thanks, Chris
Comment 4 Klaus Reimer CLA 2009-07-16 03:36:06 EDT
Confirmed that the bug is fixed in Eclipse 3.5