Created
August 27, 2010 11:17
-
-
Save samsonjs/553200 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// Reduction of corrupted JSON bug, Object.freeze is broken | |
// | |
// Related? http://groups.google.com/a/chromium.org/group/chromium-bugs/browse_thread/thread/d9b1ff90110eda2d | |
console.log('Good JSON: ' + JSON.stringify({x: null})) | |
var i = 0 | |
while (true) { | |
Object.freeze({}) | |
if (++i % 1000 === 0) console.log(i) | |
if (JSON.stringify({x: null}).match(/\0/)) { | |
console.log('Bad JSON after ' + i + ' iterations: ' + JSON.stringify({x: null})) | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment