substitutes for arguments and arguments.callee in ECMAScript 5

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Jan 5 11:43:40 PST 2011


The ultimate replacement for the arguments object is expected to be rest parameters and the spread operator: http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters and http://wiki.ecmascript.org/doku.php?id=harmony:spread

On Jan 5, 2011, at 11:30 AM, Felipe Gasper wrote:

> Am I to understand now that ECMASCript 5 will now have me type in:
> 
> ----
> var func;
> a_dialog.hideEvent.subscribe( func = function() {
>    this.hideEvent.unsubscribe( func );
>    console.log("This will only happen once.");
> } );

No, what you should type is:

a_dialog.hideEvent.subscribe(  function func() {
   this.hideEvent.unsubscribe( func );
   console.log("This will only happen once.");
} );
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110105/ea0c3e25/attachment.html>


More information about the es-discuss mailing list