Hi, I have move my application to Prototype 1.5.1 RC1 and I have an error: - with Firefox - In Firebug I got message: uncaught exception: [object Object] Any Idea ? - Firebug can''t catch or find the error - A clue: I use the official JSON library mais a conflict ? Best Regards, Jp -- Jean-Philippe Encausse - 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 Jalios: +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 -~----------~----~----~----~------~----~------~--~---
right on! json.js extends Object.prototype and thus breaks for...in loops. You should use our own JSON implementation instead. Regards, Tobie On Mar 15, 4:43 am, "Jean-Philippe Encausse" <J...-vcK5r0oTKUrk1uMJSBkQmQ@public.gmane.org> wrote:> Hi, > > I have move my application to Prototype 1.5.1 RC1 and I have an error: > - with Firefox > - In Firebug I got message: uncaught exception: [object Object] > > Any Idea ? > > - Firebug can''t catch or find the error > - A clue: I use the official JSON library mais a conflict ? > > Best Regards, > Jp > > -- > Jean-Philippe Encausse - 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 Jalios: +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 -~----------~----~----~----~------~----~------~--~---
Well in fact I don''t have time to migrate all my code do the Prototype JSON... But I have more clues, It is not JSON: In a $A().each(function(){}) I do throw $continue; It seems that it no longer works because Enumerable.each do: if (e != $break) throw e; So I will have to simply do return. On 3/15/07, tobie <tobie.langel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > right on! > > json.js extends Object.prototype and thus breaks for...in loops. > > You should use our own JSON implementation instead. > > Regards, > > Tobie > > On Mar 15, 4:43 am, "Jean-Philippe Encausse" <J...-vcK5r0oTKUrk1uMJSBkQmQ@public.gmane.org> > wrote: > > Hi, > > > > I have move my application to Prototype 1.5.1 RC1 and I have an error: > > - with Firefox > > - In Firebug I got message: uncaught exception: [object Object] > > > > Any Idea ? > > > > - Firebug can''t catch or find the error > > - A clue: I use the official JSON library mais a conflict ? > > > > Best Regards, > > Jp > > > > -- > > Jean-Philippe Encausse - 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 Jalios: +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 > > > > >-- Jean-Philippe Encausse - 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 Jalios: +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 -~----------~----~----~----~------~----~------~--~---
$continue has been deprecated, so you are right, that was your issue. Migrating to Prototype''s inbuilt JSON won''t take you that long really and will save you from a lot of trouble down the road. If you want to do it really easily replace all xxx.toJSONString() by Object.toJSON(xxx), if you need to use parseJSON (instead of evalJSON), for the inbuild filter it has, you can just add the following to your JS, else just replace xxx.parseJSON by xxx.evalJSON, (and don''t forget to use the sanitize option if your data is untrustworthy). String.prototype.parseJSON = function (filter) { try { if (/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/. test(this)) { var j = eval(''('' + this + '')''); if (typeof filter === ''function'') { function walk(k, v) { if (v && typeof v === ''object'') { for (var i in v) { if (v.hasOwnProperty(i)) { v[i] = walk(i, v[i]); } } } return filter(k, v); } j = walk('''', j); } return j; } } catch (e) { } throw new SyntaxError("parseJSON"); }; Hope this helped. Tobie On Mar 15, 5:39 am, "Jean-Philippe Encausse" <J...-vcK5r0oTKUrk1uMJSBkQmQ@public.gmane.org> wrote:> Well in fact I don''t have time to migrate all my code do the Prototype JSON... > > But I have more clues, It is not JSON: > > In a $A().each(function(){}) I do throw $continue; > > It seems that it no longer works because Enumerable.each do: > > if (e != $break) throw e; > > So I will have to simply do return. > > On 3/15/07, tobie <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > right on! > > > json.js extends Object.prototype and thus breaks for...in loops. > > > You should use our own JSON implementation instead. > > > Regards, > > > Tobie > > > On Mar 15, 4:43 am, "Jean-Philippe Encausse" <J...-vcK5r0oTKUrk1uMJSBkQmQ@public.gmane.org> > > wrote: > > > Hi, > > > > I have move my application to Prototype 1.5.1 RC1 and I have an error: > > > - with Firefox > > > - In Firebug I got message: uncaught exception: [object Object] > > > > Any Idea ? > > > > - Firebug can''t catch or find the error > > > - A clue: I use the official JSON library mais a conflict ? > > > > Best Regards, > > > Jp > > > > -- > > > Jean-Philippe Encausse - 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 Jalios: +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 > > -- > Jean-Philippe Encausse - 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 Jalios: +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 -~----------~----~----~----~------~----~------~--~---
And here''s a full walk-through for anyone interested: http://tobielangel.com/2007/3/15/migrating-to-prototype-s-native-json --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---