Mark S. Miller wrote:
On Sat, Dec 12, 2009 at 10:36 AM, Mike Samuel <[email protected]> wrote: On the String defect, we could repair that with && ({}).toString.call(obj) !== '[object String]' Cons: An extra function call in the likely case Strings are arguable array-like Pros: Strings are inconsistently indexable : (new String('foo'))[0] is undefined on IE 6 Yes, this test would work. Before incorporating it, we should discuss whether String wrapper objects should indeed be considered array-like. My inclination is that they should not. Opinions? I don't think strings should trigger array-like, and this seems to be the position held by most JS libraries (see f ex dojo.isArrayLike). The normal use of these methods is to identify things like Arguments and NodeLists, ie sequences of distinct objects/values, not character sequences (text). Anyhow, whatever is decided here I think primitive strings and String wrappers should be handled the same way in this respect. Best regards Mike
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

