Function apply and call (was RE: Bait taken: Arguments about arguments)
Mark S. Miller
erights at google.com
Thu Jan 15 22:18:24 PST 2009
On Thu, Jan 15, 2009 at 7:35 PM, David-Sarah Hopwood <
david.hopwood at industrial-designers.co.uk> wrote:
> Brendan Eich wrote:
> > On Jan 15, 2009, at 5:42 PM, David-Sarah Hopwood wrote:
> >> Allen Wirfs-Brock wrote:
> >>> I generally agree that it would be a good idea to specify apply (and
> >>> call)
> >>> pretty much as proposed below by David-Sarah. The major reason that it
> >>> makes it explicit what happens for most currently unspecified edge
> >>> such as a sparse argArray or argArray properties that are accessors.
> >> Exactly: even if the second argument to 'apply' were restricted to Array
> >> and arguments objects, the properties can (and would in the case of an
> >> arguments object specified as in the current draft) have getters.
> >> So an implementation *must* read the properties in a way that has the
> >> full generality of [[Get]], and might as well be specified using
> > This is a fix indeed.
> OK, we seem to have a rough concensus. I will open a ticket on this...
Wonderful! And Brendan, you said earlier you were open to freezing strict
arguments, and that the joining of arguments should be severed by freezing.
With these two changes, virtual-ES-strict-in-ES-strict emulations such as
future Valija will be able to easily emulate strict arguments. An emulated
strict arguments need only be a normal frozen non-array object inheriting
from Array.prototype with appropriate length, caller, callee, and
constructor properties. Otherwise, self-virtualizations would have needed to
create a genuine arguments object, since the difference would have been
observable. I should have mentioned this earlier as another motivation.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Es-discuss