You have a pretty accurate summary here.

As Max already alluded, OpenLaszlo implements ECMAScript 262-3/Javascript 1.5.  
That is officially supported.  We have added some syntax from 'es4'/'as3' 
(neither of which is an accepted standard) to support declaring classes, 
function signatures, and default arguments.  These are not officially 
supported, they are used internally.  You use our extensions "at your own 
risk", but there is every intent of supporting them going forward, and we 
expect that the 'ECMAScript Harmony' project will include a similar syntactic 
sugar.

Tracking both ECMAScript 5 and ECMAScript Harmony are goals, but there is no 
commitment to any particular timeframe.

We do have a mechanism that is intended to let you pass through code to the 
underlying platform which we hope to extend to make it possible to access ES5/6 
features even if our compiler does not support them.  See: 
http://jira.openlaszlo.org/jira/browse/LPP-8608.

Finally, as3 and our version of Javascript both support 'rest' arguments, which 
is how a strictly typed language usually handles variable parameters to a 
function.  The signature of splice in as3 would be something like:

  splice (start:int, count:int ...elements)

Which means all the arguments after the first two are untyped and gathered into 
a list as the parameter named elements.

You can test that splice works in swf10 using the OpenLaszlo debugger:

lzx> Debug.environment.foo=['a','b','c'] 
«Array(3)#6| ['a', 'b', 'c']»
lzx> foo.splice(1,1, 2, 3, 4) 
«Array(1)#7| ['b']»
lzx> foo 
«Array(5)#6| ['a', 2, 3, 4, 'c']»
lzx> 

On 2009-11-18, at 14:48, Rami Ojares / AMG Oy wrote:

> 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


Reply via email to