Skip to content

@coolaj86 /test-fail.json
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
JSON parse error
test-fail.js passes jslint.com, fails jsonlint.com, and fails to parse with Node.js JSON.parse.
{
"ID3v1": {
"title": "Michael Bolton \'\' Said i lov",
"artist": "Michael Bolton \'\' Said i lov",
"genre": "Blues"
}
}
{
"ID3v1": {
"title": "Michael Bolton '' Said i lov",
"artist": "Michael Bolton '' Said i lov",
"genre": "Blues"
}
}
var fs = require('fs');
function dbgParse(err, json) {
var data;
try {
console.log('input:', json)
data = JSON.parse(json);
console.log('parsed:');
console.log(data);
json = JSON.stringify(data, null, ' ');
console.log('stringified:', json);
data = JSON.parse(json);
} catch (e) {
console.log(e);
}
console.log('\n\n\n');
}
fs.readFile('test-pass.json', dbgParse);
fs.readFile('test-fail.json', dbgParse);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.