On Friday, September 2, 2011 5:26:58 AM UTC-7, xavierm02 wrote: > > I'll digg into it and see if I can make my API so that it is possible > to get from one to the other. This way I would allow writing code with > that API and it would be compiled to my API so that old browsers get > it. > Good luck! The problem with back-porting features like this is that the syntax is foreign to outdated JavaScript engines. A bridged api that normalizes both would be welcome, so perhaps you can experiment with an improvement to the ES5 syntax? Believe me, folks will forgo a programming feature if the syntax is too difficult... just look at CCS gradients! The only way to use them is thru toolkits and generators! One caveat: though widely accepted, the ES5 construct is still a draft and you-know-who-soft could roll the wrong way.
> Even the ES5 Object constructor lets you handle non-mapped properties. > I didn't understand what you mean by non-mapped... > You mean having a default getter? > > Yes. The ES5 Object exposes the low-level handling of undefined (or non-mapped) object members. So, when you call "foo.bar" and "bar" isn't a member of "foo", you could invoke a function that handles this non-mapped/undefined property. JavaScript engines have done this internally since the beginning. The ES5 syntax merely exposes this rigging for more control. > > One last note: I'm phasing out my own use of GSet, as it's numerous > closures actually degrade performance. > > Obviously but unless you loop on the object, i can't be that much. > You just need to store the value in a local variable when using the > object from outside. > I'm glad you're experimenting with how to make smarter objects. See my response to Scott a moment ago, regarding performance. I would only add this: as a base for other code, "small everything" is key to libraries like yours. You're right to worry about optimization later, but don't assume a tank engine can fit in a Porsche. - best, bemson -- 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]
