Joy Online Manual
NAME |
version - Get or set JavaScript version number |
SYNOPSIS |
version()
version(newVersion)
DESCRIPTION |
If called with no parameter this function returns the current JavaScript version number as an integer (e.g. 120 for JavaScript version 1.20). The start-up default is the most current Joy version (Joy2.0 is 131). All versions above 130 conform to the ECMA standard.
If called with a parameter, it switches the current interpreter to the new version and returns the old version number. You can also pass strings like "Joy" (the most current Joy version), "ECMA" (JavaScript 1.3), "1.2" (JavaScript 1.2), or "Joy2.0" instead of the numerical version numbers. You can use this feature to switch the Joy JavaScript interpreter into plain ECMA mode (with no Joy extensions) and back, for example to source some JavaScript program you grabbed off the Internet which happens to use a Joy keyword as a variable name. See the JavaScript Reference on details about version-specific behaviour of the interpreter. |
EXAMPLE |
js> version()
131
js> [1,2].toString()
[1, 2]
js> [NSObject alloc]
(NSObject *)0x1e6e54
js> version("1.0")
131
js> [1,2].toString()
1,2
js> [NSObject alloc]
missing ] after element list:
[NSObject alloc]
Index |