Hello Nick, the properties of `Array.prototype` and `Object.prototype` shouldn't be enumerable.
In fact, all properties of *built-in objects*<http://www.jibbering.com/faq/#builtInObject>should be *writable *and *configurable*, but *not enumerable*, unless other attribute values are *explicitly described* on the specification. Quoting the Section 15 intro: ES3: | 15 Native ECMAScript Objects | ... | Every other property described in this section has the attribute { DontEnum } | (and no others) unless otherwise specified. | ... Or ES5: | 15 Standard Built-in ECMAScript Objects | ... | Every other property described in this clause has the attributes | { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified. | ... And none of the properties of `Object.prototype` (15.2.4) nor `Array.prototype` (15.4.4) describe any specific property attributes. The behavior you are experiencing on Firefox seems really strange to me, since I don't remember any bug about it, and this kind of bugs are usually caught early, thanks to conformance tests such as Sputnik. I tried, but couldn't reproduce it on FF3.6.13. Are you sure you're testing on a "clean" environment? Try also: Object.prototype.propertyIsEnumerable('toString'); // should be `false` Array.prototype.propertyIsEnumerable('pop'); // should be `false` Regards, -- Christian C. Salvadó On Sat, Dec 11, 2010 at 12:18 AM, Nick Fitzgerald <fitz...@gmail.com> wrote: > Hey all, > > In FF 3.6, Array.prototype's and Object.prototype's methods are all > enumerable, however in Chrome 8.0.552.215, they aren't. Haven't tested any > other browsers yet... > > for (var key in Object.prototype) console.log(key); > // Chrome logs nothing, FF logs pop, push, filter, map, etc... > > Who got it right? > > _Nick_ > > > _______________________________________________ > JSMentors mailing list > JSMentors@jsmentors.com > http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com > > List Archive: > http://jsmentors.com/pipermail/jsmentors_jsmentors.com/ >
_______________________________________________ JSMentors mailing list JSMentors@jsmentors.com http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com List Archive: http://jsmentors.com/pipermail/jsmentors_jsmentors.com/