Disclaimer: Im still getting used to dynamic scoping. & _javascript_ as well.

Which part clobbers window.property? If this _is_ the case, then suiltably unique name would be a temporary, but if you are talking about the for() loop itself, that is unchanged from the original source... actually looking at the latest svn, Element.extend appears to have changed. Too late for me to look at it properly now, but it appears it uses some tricky scope checking to decide what to return. (would this avoid all memory leaks?) ... nice. That mofo is just too fubar for me to come up with.


On 5/10/06, Todd Ross <[EMAIL PROTECTED]> wrote:
On 5/10/06, nick hemsley <[EMAIL PROTECTED]> wrote:
>     for (property in methods) {

for (var property in methods) {

ensures that you're working with a locally-scoped property variable.
The way it's written, if window.property existed, then you just
clobbered it.

Todd
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to