In Chrome,
(function(){}).__proto__
is
function Empty() {}
so I would have expected
new Function();
to be function Empty() {}, but instead it is function anonymous() {}.
Where can I find function Empty() {}? Is it in Function or Object somewhere?
Those names don’t mean you can access them with those identifiers.
As for the prototype of a function, the name is set at startup. That function has been set a name but it doesn’t really serve any purpose other than
.nameand.toString()exposing it.As for a
new Function()instance, the name is merely printed for.toString(). So.nameis still the empty string. Again, it doesn’t serve much purpose.