problems pane

Questions and answers regarding the use of eclipse environment as seen in Servoy Developer

problems pane

Postby mboegem » Thu Aug 26, 2010 1:21 am

I was wondering: in the problems pane you have the possibility to show variables which are declared twice.

Is there a possibility to find/report all undeclared vars?
In our environment we don't use vars that arn't declared.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: problems pane

Postby pbakker » Thu Aug 26, 2010 9:46 am

Unfortunately currently not: The warning reporting is based on the JavaScript Strict mode implementation of the JavaScript engine and assigning undeclared variables is not considered wrong (unfortunatly).

The latest version of JavaScript (EcmaScript), version 5 (ES5) has formalized Strict mode and it contains 2 items to this respect:
- When the JavaScript code is running in strict mode, it's not allowed to create variables without using the var keyword
- You can "seal" objects after declaration, which means that trying to set a property that doesn't exist on the object will thrown an error, instead of adding the property.

Now, the question is: when can we have it? Dunno, unfortunately, all makers of JavaScript engines (ie most browser vendors and Mozilla Rhino (which we use)) are still working on implementing all of this. As soon as Rhino has implemented it, we can start considering upgrading the Rhino engine version used in Servoy.

In other words: it'll not happen overnight unfortunalty.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: problems pane

Postby mboegem » Thu Aug 26, 2010 9:54 am

thnkx Paul for this clarification.
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1750
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: problems pane

Postby jcompagner » Thu Aug 26, 2010 3:08 pm

one good thing is.. that in servoy 6 we will use our own parser and problem generator for the js files in the developer..

So even if Rhino doesnt support this, this will not say that we cant generate warnings or errors for it..

So you could make a case for it to see if we can make optional additional checks and how to report them (warning or error)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Eclipse Environment

Who is online

Users browsing this forum: No registered users and 8 guests