Draft of Function.prototype.bind.

Mark S. Miller erights at google.com
Mon Nov 10 16:59:28 PST 2008


On Mon, Nov 10, 2008 at 4:48 PM, Waldemar Horwat <waldemar at google.com>wrote:

> Mark S. Miller wrote:
>
>>        11. If the [[Class]] property of /G/ is *"Function"*, then
>>               1. Get the *length* property of /G/.
>>               2. Let /L/ be Result(11a) minus the length of /A/.
>>
>
> What does "minus" mean here?  Result(11a) could be anything.
>

Since this is conditional on the [[Class]] of G being "Function", doesn't
that mean the length is created as a non-configurable readonly number
property when G is created?

Step 7 of 13.2 says:

7.    Set the length property of F to the number of formal parameters
specified in FormalParameterList. If no parameters are specified, set the
length property of F to 0. This property is given attributes as specified in
15.3.5.1.

there it says:

15.3.5    Properties of Function Instances
In addition to the required internal properties, every function instance has
a [[Call]] property, a [[Construct]] property and a [[Scope]] property (see
8.6.2 and 13.2). The value of the [[Class]] property is "Function".
15.3.5.1    length
The value of the length property is an integer that indicates the "typical"
number of arguments expected by the function. However, the language permits
the function to be invoked with some other number of arguments. The
behaviour of a function when invoked on a number of arguments other than the
number specified by its length property depends on the function. This
property has the attributes { [[Writable]]: false, [[Enumerable]]: false,
[[Configurable]]: false }.


-- 
   Cheers,
   --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20081110/e7fa7d61/attachment.html>


More information about the Es-discuss mailing list