Created
August 8, 2013 12:33
-
-
Save cybrown/6184181 to your computer and use it in GitHub Desktop.
Fix for old android JSON.parse.
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
| if (window.JSON && window.JSON.parse) { | |
| try { | |
| JSON.parse(null); | |
| } catch (e) { | |
| var originalParse = JSON.parse; | |
| JSON.parse = function(value) { | |
| if (value) { | |
| return originalParse(value); | |
| } else { | |
| return value; | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment