Skip to content

Commit 42c18c6

Browse files
style
1 parent 5ca5ccb commit 42c18c6

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

json_parse.js

+18-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
json_parse.js
3-
2011-03-06
3+
2012-06-20
44
55
Public Domain.
66
@@ -160,7 +160,8 @@ var json_parse = (function () {
160160
if (ch === '"') {
161161
next();
162162
return string;
163-
} else if (ch === '\\') {
163+
}
164+
if (ch === '\\') {
164165
next();
165166
if (ch === 'u') {
166167
uffff = 0;
@@ -326,21 +327,23 @@ var json_parse = (function () {
326327
// in an empty key. If there is not a reviver function, we simply return the
327328
// result.
328329

329-
return typeof reviver === 'function' ? (function walk(holder, key) {
330-
var k, v, value = holder[key];
331-
if (value && typeof value === 'object') {
332-
for (k in value) {
333-
if (Object.prototype.hasOwnProperty.call(value, k)) {
334-
v = walk(value, k);
335-
if (v !== undefined) {
336-
value[k] = v;
337-
} else {
338-
delete value[k];
330+
return typeof reviver === 'function'
331+
? (function walk(holder, key) {
332+
var k, v, value = holder[key];
333+
if (value && typeof value === 'object') {
334+
for (k in value) {
335+
if (Object.prototype.hasOwnProperty.call(value, k)) {
336+
v = walk(value, k);
337+
if (v !== undefined) {
338+
value[k] = v;
339+
} else {
340+
delete value[k];
341+
}
339342
}
340343
}
341344
}
342-
}
343-
return reviver.call(holder, key, value);
344-
}({'': result}, '')) : result;
345+
return reviver.call(holder, key, value);
346+
}({'': result}, ''))
347+
: result;
345348
};
346349
}());

0 commit comments

Comments
 (0)