On Wed, Dec 28, 2011 at 5:59 PM, John J Barton <[email protected]>wrote:
> > > On Wed, Dec 28, 2011 at 1:15 PM, Axel Rauschmayer <[email protected]>wrote: > >> On Dec 28, 2011, at 17:13 , John J Barton wrote: >> >> Doesn't Object.keys() solve this problem? >> >> >> For getting elements, yes. For setting, the problem with the illegal own >> property name "__proto__" remains. >> >> > Doesn't this same problem face any property of an object-as-dictionary > which is also a property needed for the dictionary to work properly? So > fixing __proto__ is not important, it's inadequate? > Good uses of objects-as-stringmaps use the objects *only* as stringmaps. Aside from the use of "hasOwnProperty" as an instance method in Crock's original example, which he elsewhere shows how to correct, Crock's "registry" is used correctly. Together with the proposed __proto__ as accessor behavior, Crock's code would actually be correct (though I'd still advise using an abstraction like StringMap that can encapsulate such hazards and present a simple interface). -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

