On Wed, Dec 28, 2011 at 1:09 AM, Axel Rauschmayer <a...@rauschma.de> wrote:
> The cleanest solution to the problem you outlined seems to be to never use > objects as dictionaries(?) That is, one would separate the concerns program > definition and application data. Allen’s object model reformation (allowing > one to override the [] operator) would help, too. > http://wiki.ecmascript.org/doku.php?id=strawman:object_model_reformation > Hi Axel, I agree that we should encourage programmers to stop using object directly as maps from strings to values because of these hazards. In fact, Caja and SES are moving all such uses over to using the StringMap abstraction at < http://code.google.com/p/es-lab/source/browse/trunk/src/ses/StringMap.js>. My point was not that programmers *should* use objects-as-stringmaps, but rather that the hazards created by the diversity of unspecified magical __proto__ behaviors is a hazard that has tripped up many, including expert JS programmers. If we pin down its normative-optional semantics, then when present, it will at least behave in a consistently bizarre manner. As FF, Dave, and Lasse suggest, the least magical way for this to act is as an accessor inherited only from Object.prototype. -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss