A random collection of ES4 draft spec surprises and thoughts

Brendan Eich brendan at mozilla.org
Mon May 26 23:48:48 PDT 2008


On May 26, 2008, at 11:40 PM, Maciej Stachowiak wrote:

> On May 26, 2008, at 11:58 AM, Jason Orendorff wrote:
>
>> As far as I know, this is unchanged from ES3, in which "functions are
>> permitted to return References" but "This possibility is admitted
>> purely for the sake of host objects. No built-in ECMAScript function
>> defined by this specification returns a reference and there is no
>> provision for a user-defined function to return a reference.":
>>  http://bclary.com/2004/11/07/#a-8.7
>> and an implementation that doesn't hold with such nonsense is also
>> allowed to reject "foo(a)++" as a syntax error:
>>  http://bclary.com/2004/11/07/#a-16
>
> In practice, for Web compatibility, it has to be a runtime error not a
> parse error.

Could you provide a list of URLs? We added support for "lvalue  
return" to SpiderMonkey years ago, based on someone using the code  
and wanting to port VBScript-infected JScript. I don't recall the  
name (it wasn't AOL :-P), but there may be a post from me in reply on  
the old "jseng" Mozilla USENET group.


> I don't know of any implementation making use of a
> function returning a reference however (in WebKit's implementation
> Reference is not a real type, just a spec fiction, and I assume this
> is true in other implementations).

SpiderMonkey erases References except where a native function calls a  
special API to return one.

/be




More information about the Es4-discuss mailing list