Asen Bozhilov wrote: > Scott Sauyet: >> I'm looking for a critique of an API. I built this some months ago, >> and might need it again, and would love to have other eyes on it. > >> On a recent project I found myself in need of some configuration data >> that could be easily changed, data in which one value was based upon >> another. And I created a generic constructor function to do it. I >> have no idea if this would be useful to anyone else, but just in case, >> I thought I'd share. > > If I remember correct I and Stefan Weiss have discussed the API at > c.l.js before.
Oh? Somehow I missed the replies. I'll see if I can find them. > 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. Thanks for the response, -- Scott -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com