Function apply and call (was RE: Bait taken: Arguments about arguments)
brendan at mozilla.com
Thu Jan 15 22:27:23 PST 2009
On Jan 15, 2009, at 10:18 PM, Mark S. Miller wrote:
> Wonderful! And Brendan, you said earlier you were open to freezing
> strict arguments, and that the joining of arguments should be
> severed by freezing.
Yes. This is easy to implement with a few strict mode checks in
existing arguments implementations I know of. Other implementors
should give their thoughts, of course.
> 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.
That's a good point. Emulating arguments with its magic data
properties that a mysterious agent (as Allen put it) keeps in sync
with parameters is Hard(tm).
More information about the Es-discuss