On Tue, Feb 15, 2011 at 8:22 AM, Scott Sauyet <[email protected]>wrote:

> Asen Bozhilov wrote:
>

[...]

 > It seems API is enough useful and convenient, I am
> > interested in the opinion of the others members, too.
>
> > Only one issue with:
> > merge = function(base, ext) {
> >  //...
> >
> > };
> >
> > I don't know which engines are target of your code, but older JScript
> > versions has trouble with enumeration of user defined properties which
> > are same as bult-in properties of `Object.prototype'.
> >
> > See the blog post of Garret:
> > <URL:http://dhtmlkitchen.com/learn/js/enumeration/dontenum.jsp>
> >
> > If you are interested, see how I've fixed the issue:
> > <URL:https://github.com/abozhilov/Duke/blob/master/src/Duke.js>
>
> Interesting, I'd forgotten about that issue.  And I'm curious about
> your solution:
>
> |    DontEnums = [
> |        'constructor',
> |        'toString',
> |        'valueOf',
> |        'toLocaleString',
> |        'isPrototypeOf',
> |        'propertyIsEnumerable',
> |        'hasOwnProperty'
> |    ];
>
> Is that list sufficient?  It seems suspiciously small.  But I don't
> have additional candidates right now.
>

That's sufficient. You only need to take care of Object.prototype.* 7
non-enumerable members. See 15.2.4 in either ES3 or ES5 (e.g:
http://es5.github.com/#x15.2.4-toc).

The "DontEnum bug" is fixed in IE9 by the way (among
other long-standing JScript issues, like named function expressions leaking
identifier into the enclosing scope).

[...]

-- 
kangax

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to