Jean-Philippe Encausse
2007-Oct-24 15:31 UTC
Other API using Object.prototype breaks prototype.js for/in loop
Hi there, As some of you may already know, Really Simple History 0.6 beta has been released yesterday : http://code.google.com/p/reallysimplehistory/ Unfortunately, using it has brought this issue to our attention : If another javascript API extends javascript object using Object.prototype, prototype.js will break in several places when calling for/in loops. You can see a test case of this problem with some explanation here : http://support.jalios.com/rshPrototype/index.html We have already opened an issue at RSH http://code.google.com/p/reallysimplehistory/issues/detail?id=6 But could you consider modifying prototype.js in order to use the hasOwnProperty check shown in the following link to prevent prototype from breaking with other API http://yuiblog.com/blog/2006/09/26/for-in-intrigue/ Thanks for your answer -- Jean-Philippe Encausse - Veille / R&D Jalios SA Jp [at] encausse.net - http://www.encausse.com - http://www.jalias.com GTalk: jp.encausse [at] gmail.com - SMS: sms [at] jp.encausse.net Mob: +33 6 82 12 56 99 - Job: +33 1 39 23 92 83 - Tel: +33 1 39 18 90 15 Do it Once, Use it Twice ~ Do it Twice, Make It Once --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Matt Foster
2007-Oct-24 18:09 UTC
Re: Other API using Object.prototype breaks prototype.js for/in loop
That is unfortunate for RSH, you really must understand how taboo
Object.prototype is and this is exactly why.
For a history solution that doesn''t involve such issues mentioned
above feel free to check out this article,
http://positionabsolute.net/blog/2007/07/javascript-history-service.php
-- Works in IE, FF, Safari and Opera 9+
Cheers,
Matt
On Oct 24, 11:31 am, "Jean-Philippe Encausse"
<J...-vcK5r0oTKUrk1uMJSBkQmQ@public.gmane.org>
wrote:> Hi there,
>
> As some of you may already know, Really Simple History 0.6 beta has been
> released yesterday :http://code.google.com/p/reallysimplehistory/
>
> Unfortunately, using it has brought this issue to our attention :
> If another javascript API extends javascript object using
> Object.prototype, prototype.js will break in several places when calling
> for/in loops.
>
> You can see a test case of this problem with some explanation here
:http://support.jalios.com/rshPrototype/index.html
>
> We have already opened an issue at
RSHhttp://code.google.com/p/reallysimplehistory/issues/detail?id=6
> But could you consider modifying prototype.js in order to use the
> hasOwnProperty check shown in the following link to prevent prototype
> from breaking with other
APIhttp://yuiblog.com/blog/2006/09/26/for-in-intrigue/
>
> Thanks for your answer
>
> --
> Jean-Philippe Encausse - Veille / R&D Jalios SA
> Jp [at] encausse.net -http://www.encausse.com-http://www.jalias.com
> GTalk: jp.encausse [at] gmail.com - SMS: sms [at] jp.encausse.net
> Mob: +33 6 82 12 56 99 - Job: +33 1 39 23 92 83 - Tel: +33 1 39 18 90 15
> Do it Once, Use it Twice ~ Do it Twice, Make It Once
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---