Re: deprecating __proto__

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: deprecating __proto__

by Benjamin Smedberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Igor Bukanov wrote:
> Given that ES 3.1 has added Object.getPrototypeOf, should SpiderMonkey
> deprecate __proto__? For the code that sets the __proto__,
> Object.setPrototypeOf can be provided.

The only use of __proto__ that I'd like to keep is

let obj = { __proto__: someprotoobj,
             prop: 'a' };

We use this construct in dehydra/treehydra to layer scopes on top of the
global object.

--BDS
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine

Re: deprecating __proto__

by Mike Shaver :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Jul 11, 2008 at 3:34 PM, Benjamin Smedberg
<benjamin@...> wrote:
> Igor Bukanov wrote:
>> Given that ES 3.1 has added Object.getPrototypeOf, should SpiderMonkey
>> deprecate __proto__? For the code that sets the __proto__,
>> Object.setPrototypeOf can be provided.
>
> The only use of __proto__ that I'd like to keep is
>
> let obj = { __proto__: someprotoobj,
>             prop: 'a' };

__proto__'s not going anywhere; too much working code would cease to
be working, for no gain.

It might make sense to warn content script that they shouldn't use
__proto__ if we decide to do that for other extensions (import/export,
function statements, octal-09, the E4X function::), but I don't think
it's worth the code personally.

Mike
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine
LightInTheBox - Buy quality products at wholesale price