Bug 268066 - Unexpected 'Cannot make a static reference to the non-static function x(any) from the type Y'
Summary: Unexpected 'Cannot make a static reference to the non-static function x(any) ...
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.0.4   Edit
Hardware: PC Windows XP
: 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: 2009-03-11 05:02 EDT by Robin CLA
Modified: 2010-03-03 11:14 EST (History)
0 users

See Also:
thatnitind: review+


Attachments
Updates the library file (970 bytes, patch)
2009-03-12 15:41 EDT, Chris Jaun CLA
thatnitind: iplog+
thatnitind: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin CLA 2009-03-11 05:02:24 EDT
function fromCharCode(charCode) {
	return String.fromCharCode(charCode); // Error marker
}

results in 'Cannot make a static reference to the non-static function fromCharCode(any) from the type String'
Comment 1 Chris Jaun CLA 2009-03-12 13:37:40 EDT
Hi Robin,

I can't reproduce this problem in 3.0.4 or 3.1 with the code snippet you provided.

Was there anything else in the file? Were there other JS files in the project?

Were you using the JS editor or were you inside an html/jsp page?
Comment 2 Robin CLA 2009-03-12 14:43:35 EDT
I found out what is causing the error.

It's caused by including the IE Support Library. Probably conflicting with JavaScript Language (ECMA-262) Library

That saying I think that
String.prototype.fromCharCode=function(args){}; //IE

is declared wrong,
it should be:

String.fromCharCode=function(chars){}; //ECMA
Comment 3 Chris Jaun CLA 2009-03-12 15:41:42 EDT
Created attachment 128614 [details]
Updates the library file
Comment 4 Chris Jaun CLA 2009-03-12 15:43:31 EDT
Should be fixed in 3.0.4 and 3.1.

Thanks for pointing me to the problem with the library file Robin.
Comment 5 Nitin Dahyabhai CLA 2009-04-02 03:11:59 EDT
Applied to 3.1m7
Comment 6 Nitin Dahyabhai CLA 2009-04-13 15:29:35 EDT
Applied to 3.0.5.  Thanks, Chris.