Language Syntax

This is a quick summary of the Ejscript syntax. For a more detailed specification, see the official ECMAScript-262 Language Specification document.

Language Tokens

Ejscript is case sensitive and uses UTF-8 as its input character stream. White space between tokens is ignored with the exception that statements that omit trailing semicolons must be on a line by themselves.

Comments

Comments can use either the C commenting style with text between /* */ delimiters, or the C++ style may be used where text from // to the end of the line is regarded as a comment.

Identifiers

Identifiers are names used for variables and functions. Identifiers must begin with either a letter, an underscore '_', dollar sign '$' or an '@'. Identifiers must not be a reserved word from the table below:

Reserved Words

Ejscript regards all these words as reserved:

abstract, as, break, case, call, callee, cast, catch, class, const, continue, debugger, default, delete, do, dynamic, each, else, enum, enumerable, extends, false, final, finally, for, function, generator, get, goto, has, if, implements, in, include, instanceof, interface, internal, intrinsic, is, like, let, module, namespace, native, new, null, override, private, protected, prototype, public, readonly, return, set, standard, static, strict, super, synchronized, switch, this, throw, to, true, try, typeof, var, undefined, use, void, volatile, while, with, and yield.

It is also recommended that you do not use any of the following words as ECMA standards may implement them in future:

abstract, boolean, byte, char, double, export, float, long, package, short and transient.

© Embedthis Software. All rights reserved.