it's like bringing realm all over in any part of any piece of code ... a road to hell for interoperability and/or security.
I think you don't really want to: 1. include any jurassic JS library that has no reason to be used in current JS status 2. be sure that libraries that extend native constructor do that for good reason and most likely will never conflict with any API Point one is because there are not many lib out there these days that pollutes global native prototypes but I have one, called eddy, that does not conflict with anything and set configurable and writable properties, but not enumerable, in a way everybody expect them to behave (de-facto EventEmitter standard) Not a single library, neither in node.js, ever had a conflict or problem with that ^_^ As summary: choose your libraries carefully. That will do a much better job than your proposal. my 2 cents On Wed, Sep 25, 2013 at 8:41 AM, Michaël Rouges <[email protected]>wrote: > Hi all, > > Given the number of scripts from various sources that may be contained in > a web page, there may be prototyping conflicts. > > To solve this, heavy techniques are often used, such as iframes, to execute > code in peace. > > I'm often thinking it might be much easier to tell the browser to have a > native to a given context, incidentally, to the functions from this > context & nested, regarding on the last relative scope with this > instruction. > > What I suggest, therefore it is a complementary mode to `'use strict'`... > the `'use native'`. > > Suggested behavior : > > `Object.prototype.serialize = function serialize() { > // serialization code > }; > > (function () { > 'use strict', 'use native'; > > Object.prototype.hasOwnProperty('serialize') // false > > Object.prototype.serialize = function serialize() { > // serialization code > }; > > (function () { > Object.prototype.hasOwnProperty('serialize') // true > }()); > > (function () { > 'use native'; > > Object.prototype.hasOwnProperty('serialize') // false > }()); > } ());` > > Thanks in advance for your advices. > > > Michaël Rouges - https://github.com/Lcfvs - @Lcfvs > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

