On Wed, Oct 5, 2011 at 10:37 PM, Brendan Eich <bren...@mozilla.com> wrote:
> On Oct 5, 2011, at 9:02 PM, John J Barton wrote: > > > PrototypeJS (and Firebug) pre-date Object.keys() and .hasOwnProperty(), > > hasOwnProperty was in ES3 in 1999. PrototypeJS is IIRC 2005-era. Firebug is > post-y2k. > > > > so their implementation was just what could be done, not what was > desired. > > Seems unhistorical :-|. > Ok, so what is your theory then? This code was written by two of the premier JavaScript developers. If for..in was intended, then Object.extend should also use for...in. The experiment has been done, and for..in is the correct semantics. If for..in was not intended then what? If developers of this caliber aren't using the new results here, that's really discouraging. Actually there is a third possibility: it really does not matter. The differences are not significant. jjb > > > > Trait.create() parallels Object.create() and I gather that > Trait.compose() resembles proposed Object.extend(). I wonder if the > traits.js 'parallel-universe' could be applied to Trait.resolve(). In my > experience resolve() isn't needed, but academic work on traits suggests > otherwise, so it might be a good thing to investigate. > > Tom Van Cutsem should weigh in. > > /be > >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss