Google Groups

Re: Documentation for Function is Still Containing incorrect Info


Tom Schuster Aug 18, 2012 3:17 AM
Posted in group: mozilla.dev.tech.js-engine
Looks like there was still some small bug on MDN. I think I fixed it now.

On Sat, Aug 18, 2012 at 11:06 AM, Masquerade <msqw...@yahoo.com> wrote:
> Comment on latest update (Aug 17, 2012)
>
> First it is best to illustrate with some test code done on firefox 14:
>
>         ar=Object.getOwnPropertyNames(Function);
>         alert(ar);
>         ar=Object.getOwnPropertyNames(Function.prototype);
>         alert(ar);
>         fobj();
>         function fobj() {
>                 ar=Object.getOwnPropertyNames(fobj);
>                 alert(ar);
>                 alert(Function.prototype.isPrototypeOf(fobj));//true
>         }
>
> So, we can compare what properties (non-inherited) each object has:
>
>         Function constructor:
>         prototype, length ,name, arguments, caller
>
>         Function.prototype:
>         constructor,  toSource, toString, apply, call, bind, isGenerator, length, arguments, caller
>
>         ordinary function objects
>         prototype, length ,name, arguments, caller
>
> As evident from the test code, an ordinary function object created by the function keyword does has its own non-inherited properties (prototype, length ,name, arguments, caller) and so does the global Function
> (since it is just another function) but these are not described in the documentation.
>
> The Function.prototype does has a lot of properties/methods (constructor,  toSource, toString, apply, call, bind, isGenerator, length, arguments, caller) but the current documentation only describe some of them (the methods apply, call, bind, isGenerator, toSource, toString) but constructor, length, arguments, caller are not covered.
> _______________________________________________
> dev-tech-js-engine mailing list
> dev-tech-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-js-engine