Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "VJET/Typing Variables with VJETDoc"

(New page: For JavaScript the comment declaration has the following parts: final -- optional but if used must precede the type type -- required, may be preceded by final Examples of variable decla...)
 
 
Line 21: Line 21:
  
 
[[Category:VJET]]
 
[[Category:VJET]]
 +
[[Category:VJETDoc]]

Latest revision as of 14:00, 5 December 2012

For JavaScript the comment declaration has the following parts:

final -- optional but if used must precede the type

type -- required, may be preceded by final

Examples of variable declaration:

var n = 5;         //< final int
var s = 'Hello';   //< String
var str = 'World'; //< final String

Redeclaration

While Javascript allows variable re-declaration, Vjet validation is stricter. You can only declare a variable once. So, for example, the following would be an error. If a variable is re-declared using Vjet in the same scope as another declaration, it is an error.

var n = 5;  //< int
var n;  //< String ; this redeclare would result in an error

Back to the top