Joy Online Manual
Differences between Joy and ECMA JavaScript
Joy is mostly a superset of the language defined in the ECMA standard. There are, however, a few conflicts, such as new keywords which would previously have been accepted as identifiers in ECMA JavaScript. All the incompatibilities are summarized in this chapter. If you want to run pure ECMA programs, you can switch any Joy JavaScript interpreter into ECMA mode and back again using the version function.
Joy keywords that are legal identifiers in the ECMA standard |
Class
SEL
__asm
__asm__
__attribute__
__const
__const__
__declspec
__declspec__
__inline
__inline__
__signed
__signed__
__stdcall
__stdcall__
__volatile
__volatile__
asm
auto
enum
extern
id
inline
register
signed
sizeof
struct
typedef
union
unsigned
Joy keywords that are "reserved" by the ECMA standard |
catch
char
const
double
float
int
long
short
static
super
throw
try
volatile
Joy keywords that are defined differently from the ECMA standard |
void
The JavaScript void operator is not present in Joy; you have to use (void) instead. |
Restricted productions |
Joy changes the following ECMA production:
MemberExpression: to: MemberExpression: This change was necessary to make automatic semicolon insertion work between adjacent Objective-C message expressions. |
Char literals |
Joy interprets singly-quoted strings of length 1 or 4 as char literals, while ECMA JavaScript would interpret them as strings. |
Index |