# proposal extensions (Was: Re: Sep 26 meeting notes)

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Sep 29 16:20:08 PDT 2011


On Sep 29, 2011, at 3:44 PM, Brendan Eich wrote:

>> 
> 
> AFAIK, "we have them" is false in ES5 -- implicitly created primitive wrappers do not escape, and engines do optimize them away.

Yup, you are MarkM are correct about that.  The implicit ones don't escape if you keep inside strict mode.
> 
> With <| you could argue you're not leaking the wrapper, rather a clone it, but that's easily optimized to avoid the clone, and in any case the hackle-raising thing is the implicit primitive wrapper "escaping". Maybe I'm overreacting, though.

I don't see foo <| "abc" as creating an implicit wrapping.  I see it as explicit wrapping as you have to create a wrapper in order to set [[Prototype]] to foo.

But, of limited utility.  Syntactic restrictions are cheaper to implement than not very useful semantics.  However, the ore such syntactic restrictions we have the more the language feels like a patchwork of special cases.

Allen






More information about the es-discuss mailing list