Skip to content

Instantly share code, notes, and snippets.

@catrope
Created April 4, 2013 05:38
Show Gist options
  • Save catrope/5308082 to your computer and use it in GitHub Desktop.
Save catrope/5308082 to your computer and use it in GitHub Desktop.
[2013-04-03 22:31:43 PDT] catrope@roanS9:~$ cat crash.js
var a = {};
a.b = a;
alert( JSON.stringify( a, function ( key, val ) {
// This technically needs an if statement to check that val is an object or array,
// but for this test it doesn't matter
var normalized = {}, keys = Object.keys( val ).sort(), i = 0, len = keys.length;
for ( ; i < len; i++ ) {
normalized[keys[i]] = val[keys[i]];
}
return normalized;
} ) );
[2013-04-03 22:31:46 PDT] catrope@roanS9:~$ phantomjs-1.9.0-linux-x86_64/bin/phantomjs crash.js
(runs forever) ^C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment