Function.prototype.toString spec
Lars T Hansen
lth at acm.org
Sun Dec 2 00:46:13 PST 2007
Aware of it. This has been resolved in favor of making the spec say
(effectively) "FunctionDeclaration or FunctionExpression".
--lars
On 12/2/07, Peter Michaux <petermichaux at gmail.com> wrote:
> ECMA-262 3rd
>
> == section 15.3.4.2 ==
>
> Function.prototype.toString returns a representation with syntax of
> FunctionDeclaration
>
>
> == section13 ==
>
> FunctionDeclaration:
> function Identifier ( FormalParameterList_opt ) { FunctionBody }
>
> FunctionExpression:
> function Identifier_opt ( FormalParameterList_opt ) { FunctionBody }
>
>
> == Firefox results ==
>
> alert((function(){}).toString())
>
> // outputs
>
> function () {
> }
>
> Note there is no Identifier in this output and an identifier is
> required in FunctionDeclaration syntax. Should
> Function.prototype.toString be specified to return a representation
> with FunctionExpression syntax?
>
> Thanks,
> Peter
> _______________________________________________
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es4-discuss
>
More information about the Es4-discuss
mailing list