Skip to content

Commit

Permalink
enchanced error message
Browse files Browse the repository at this point in the history
  • Loading branch information
makamaka committed Mar 19, 2010
1 parent 339bbc0 commit 4c4bf0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -19,6 +19,7 @@ In this version, JSON was totally rewritten.
2.XX
[JSON::PP]
- fixed encode an overloaded 'eq' object bug (reported by Alexey A. Kiritchun)
- enhanced an error message compatible to JSON::XS

2.17 Thu Jan 7 12:23:13 2010
[JSON]
Expand Down
2 changes: 2 additions & 0 deletions lib/JSON/PP.pm
Expand Up @@ -822,6 +822,7 @@ BEGIN {
}
else{
unless ($loose) {
$at -= 2;
decode_error('illegal backslash escape sequence in string');
}
$s .= $ch;
Expand Down Expand Up @@ -1219,6 +1220,7 @@ BEGIN {
: $c == 0x0d ? '\r'
: $c == 0x0c ? '\f'
: $c < 0x20 ? sprintf('\x{%x}', $c)
: $c == 0x5c ? '\\\\'
: $c < 0x80 ? chr($c)
: sprintf('\x{%x}', $c)
;
Expand Down

0 comments on commit 4c4bf0c

Please sign in to comment.