You're misunderstanding __proto__
.
__proto__
returns the prototype value that the object inherits; not its constructor.
All functions (including Function
itself) inherit Function.prototype
.
Thus, Function.__proto__ === Function.prototype
is true.
This object is specified in section 15.3.4 of the spec:
The Function prototype object is itself a Function object (its [[Class]]
is "Function"
) that, when invoked, accepts any arguments and returns undefined.
See also
15.3.4.2 Function.prototype.toString ( )
An implementation-dependent representation of the function is returned. This representation has the syntax of a FunctionDeclaration. Note in particular that the use and placement of white space, line terminators, and semicolons within the representation String is implementation-dependent.
The toString
function is not generic; it throws a TypeError exception if its this value is not a Function object. Therefore, it cannot be transferred to other kinds of objects for use as a method.