Return value of 'eval("function z() {...}"'?

Mike Samuel mikesamuel at gmail.com
Thu Feb 24 15:24:01 PST 2011


Nothing.

>From chapter 14:

The production SourceElement : FunctionDeclaration is evaluated as
follows: 1.	Return (normal, empty, empty).

2011/2/24 Dave Fugate <dfugate at microsoft.com>:
> By ES5.1, what would we expect to be ‘x’ in the following snippet:
>
>                 x = eval("function z() {return 1;}");
>
>
>
> ‘undefined’, ‘z’, or something else entirely?
>
>
>
> Thanks!
>
>
>
> Dave
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>


More information about the es-discuss mailing list