See the following URL for all the gory details:

http://stackoverflow.com/questions/1288962/ie8-native-json-parse-prototype-stack-overflow

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to