I am a bit confused about ecmascript versions.
If someone has good links or understanding I would like to hear.
This is what I read from wikipedia:
1) Ecmascript Edition 3
is the base version used in most javascript engines
(all previous versions can be considered historical)
This goes also by name Javascript 1.5
!! Laszlo implements this with a few noted exceptions.
2) Fourth Edition
"was abandoned, due to political differences concerning language
complexity, with some of the work forming the basis of Fifth Edition and
some forming the basis of ECMAScript Harmony."
!! Actionscript 3 is a "completely conforming implementation of the
ECMAScript fourth edition draft specification."
3) ECMAScript, 5th Edition
is a less ambitious update of ECMAScript 3
This standard is expected to be finished by the end of 2009.
At the same time Javascript has had new releases namely
- 1.6
- E4X, Array extras (e.g. Array.prototype.forEach)
- Array and String generics
- 1.7
- Pythonic generators and array comprehensions ([a*a for (a in iter)])
- block scope with let
- destructuring assignment (var [a,b]=[1,2])
- 1.8
- expression closures (function(x) x * x)
- generator expressions
- and more
These are implemented at least in Firefox Gecko.
4) ECMAScript Harmony
"In the same announcement, ECMA TC39 also stated that the ECMAScript 4
proposal would be superseded by a new project, code-named ECMAScript
Harmony. ECMAScript Harmony will include syntactic extensions,
!!! but the changes will be more modest than ECMAScript 4 in both
semantic and syntactic innovation. Packages, namespaces and early
binding from ECMAScript 4 are no longer included for planned releases.
In addition, other goals and ideas from ECMAScript 4 are being rephrased
to keep consensus in the committee; these include a notion of classes
based on ECMAScript, 5th Edition"
The first question I have is this:
ecmascript 3rd edition defines for example the method
array.splice(index, howMany, [element1][, ..., elementN]);
(Taken from developer.mozilla.org/en/Core_JavaScript_1.5_Reference)
Here there is an indefinate amount of arguments and only the first 2 of
them are mandatory.
From experience I know that actionscript 3 is strict about the exact
amount of arguments. And maybe that comes from edition 4.
Laszlo says it is implementing edition 3 it seems to be valid laslo.
So what will happen to that call when translated to flash 10 runtime?
Is the javascript passed through to flash or is it first parsed into
object model and then translated into actionscript 3?
And how would it be event possible to implement that sort method in
actionscript 3 with the indefinate number of arguments?
- rami