ECMAScript 4 Netscape Proposal
Compatibility
|
Friday, March 14, 2003
ECMAScript 4 is intended to be upwards compatible with almost all ECMAScript 3 and earlier scripts. The following are the current compatibility issues:
[
expr,
expr]
should be replaced by expr[(
expr,
expr)]
.for
-in
variable; the =b
in the statement for (var a=b in c)
...
is not allowed.as
, is
, namespace
, and use
need to be renamed
or escaped with \_
because these are now reserved words.Boolean
, Number
, and String
. Boolean
,
Number
, and String
now refer to classes that have primitive booleans, numbers, and strings as
instances. The methods of these new classes correspond to the methods of ECMAScript 3’s wrapper classes. The results
of calling new
on Boolean
, Number
, or String
are now implementation-defined,
so an implementation may choose to retain the wrappers for compatibility with ECMAScript 3, but it is not required to
do so.Object
and String
may not work.For applications such as browsers where 100% compatibility is needed, scripts will be assumed to be written ECMAScript
3 unless explicitly marked as being ECMAScript 4 through either an HTML or XML attribute or by including a use ecmascript(4)
statement.
Waldemar Horwat Last modified Friday, March 14, 2003 |