This is a Prototype bug and will be fixed in version 1.7. In the meantime, please use Object.toJSON(...) instead.
Best, Tobie On Aug 20, 10:53 am, "T.J. Crowder" <t...@crowdersoftware.com> wrote: > Hi, > > Wait! Stop the presses, are you saying IE8 has...a bug in it? ;-) > (Oh, I shouldn't be mean to Microsoft, all browsers have bugs in them, > and they seem to have made quite an effort in IE8.) > > Have you reported the bug to Microsoft? > > Seriously, though, thank you for doing the research to why it breaks > and posting the info here, very very useful -- I'm sure you just saved > the core team a fair bit of time hunting this down. > -- > T.J. Crowder > tj / crowder software / com > Independent Software Engineer, consulting services available > > On Aug 19, 9:58 pm, Joel <joel.muel...@gmail.com> wrote: > > > > > See the following URL for all the gory details: > > >http://stackoverflow.com/questions/1288962/ie8-native-json-parse-prot... > > > But to sum up, the following test case will get an "out of stack > > space" error in IE8 when it is running in IE8 Standards mode (you can > > check the mode by hitting F12 for the Developer Tools). If you comment > > out either the Function.prototype line or the Array.prototype line, > > you won't get the error. > > > Because Prototype adds functions to both Array.prototype and > > Function.prototype, pages that use Prototype will get the "out of > > stack space" error whenever they try to use the native JSON parser to > > parse some JSON that contains an array. But only if they pass a > > "reviver" function to the JSON.parse() method. Which, unfortunately, > > is pretty common in order to handle dates. > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > > <html xmlns="http://www.w3.org/1999/xhtml"> > > <head> > > <title></title> > > <script type="text/javascript"> > > > Function.prototype.test1 = function() { }; > > Array.prototype.test2 = function() { }; > > > window.onload = function() > > { > > alert(JSON.parse('{ "foo": [1,2,3] }', function(k,v) { return > > v; })); > > } > > > </script> > > </head> > > <body> > > > </body> > > </html> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---