Skip to content
kazuho edited this page Jul 2, 2012 · 7 revisions

Following types of statements are supported by JSX. The differences from JavaScript are:

  • block statements cannot have labels
  • the introduction of super(...) statement
  • delete is a statement instead of an expression
  • argument of catch clause can be typed, and thus the clause is nestable
Statement Description
; empty statement
{ statement* } block statement
expr; evaluates the expr
return; returns void
return expr; returns the result of the expr
if (expr) statement [else statement] if statement
var varname[ = expr][, varname2 = expr2, ...]; variable declaration
break; exits from the inner-most loop or switch statement
break LABEL; exits to the loop or switch statement with label LABEL
continue; skips to the end of the loop statement
continue LABEL; skip to the end of the loop statement with label LABEL
[LABEL:]do statement while (expr);
[LABEL:]for (expr in expr) statement
[LABEL:]for (var varname in expr) statement
[LABEL:]for (expr; expr; expr) statement
[LABEL:]for (var varname = expr; expr; expr) statement
[LABEL:]while (expr) statement
[LABEL:]switch (expr) statement
case expr:statement
default:statement
delete expr; deletes the property of a Map returned by the expr
super(...); calls the constructor of the super class
try { statement* } [catch (varname : type) { statement* }]* [finally { statement* }] catch statement can be nested
Clone this wiki locally