Maybe some new API, like `createPrototypeModified(obj, newPrototype)`, it copies all eigen-properties of `obj` to a new object with its prototype is `newPrototype`.
---------------------------------------- > From: infinte.c...@hotmail.com > To: es-discuss@mozilla.org > Subject: Is __proto__ ready needed? > Date: Mon, 10 Jun 2013 17:06:24 +0800 > > I think that once an object is created, its prototype should be constant. > > And we should add features to implement sub-typing built-in types, like > Array, since this code exists (found in Zepto): > > zepto.Z = function(dom, selector) { > dom = dom || [] > dom.__proto__ = $.fn > dom.selector = selector || '' > return dom > } > > Using proxies may be one way, but it should be more convinent. > _______________________________________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss