Function.prototype, [[Call]] and [[Construct]]

Garrett Smith dhtmlkitchen at
Mon Nov 9 15:50:24 PST 2009

[[Construct]] of Function.prototype is not standardized.

The definition of Function.prototype does not define the expected
behavior for [[Call]] or [[Construct]]. Instead, there is a
description of what happens when it is invoked:

| 15.3.4 Properties of the Function Prototype Object
|  The Function prototype object is itself a Function
| object (its [[Class]] is "Function") that, when
| invoked, accepts any arguments and returns undefined.

Should Function.prototype implement [[Construct]]? Either way, the
specification should state the outcome.

Trying it out:

javascript: alert( new Function.prototype );

IE 6-8:
Error: Object doesn't support this action

Other browsers tested return an Object, indicating the [[Construct]]
is implemented.

The specification should state whether or not Function.prototype
implements [[Construct]], to clarify expected outcome, and to
encourage consistent implementations.


More information about the es-discuss mailing list