Bug 268066

Summary: Unexpected 'Cannot make a static reference to the non-static function x(any) from the type Y'
Product: [WebTools] JSDT Reporter: Robin <robinpelgrim>
Component: GeneralAssignee: Chris Jaun <cmjaun>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 Keywords: contributed
Version: 3.0.4Flags: thatnitind: review+
Target Milestone: 3.0.5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Updates the library file thatnitind: iplog+, thatnitind: review+

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.