Skip to content

Commit

Permalink
Add small clarifying comment in String#evalJSON. [close #295]
Browse files Browse the repository at this point in the history
  • Loading branch information
savetheclocktower committed May 13, 2015
1 parent de0bead commit 6493bdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/prototype/lang/string.js
Expand Up @@ -755,6 +755,7 @@ Object.extend(String.prototype, (function() {
try {
if (!sanitize || json.isJSON()) return eval('(' + json + ')');
} catch (e) { }
// If we get this far, the string is not valid JSON.
throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
}

Expand Down

0 comments on commit 6493bdc

Please sign in to comment.