Skip to content

Commit f708242

Browse files
committed
Fixed some linting problems.
1 parent 5394740 commit f708242

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

jquery.json.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* jQuery JSON Plugin
3-
* version: 2.0 (2009-08-14)
3+
* version: 2.1 (2009-08-14)
44
*
55
* This document is licensed as free software under the terms of the
66
* MIT License: http://www.opensource.org/licenses/mit-license.php
@@ -107,7 +107,7 @@
107107

108108
return "{" + pairs.join(", ") + "}";
109109
}
110-
}
110+
};
111111

112112
/** jQuery.evalJSON(src)
113113
Evaluates a given piece of json source.
@@ -117,7 +117,7 @@
117117
if (JSON && JSON.parse)
118118
return JSON.parse(src);
119119
return eval("(" + src + ")");
120-
}
120+
};
121121

122122
/** jQuery.secureEvalJSON(src)
123123
Evals JSON in a way that is *more* secure.
@@ -159,10 +159,10 @@
159159
if (typeof c === 'string') return c;
160160
c = a.charCodeAt();
161161
return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
162-
}) + '"'
162+
}) + '"';
163163
}
164164
return '"' + string + '"';
165-
}
165+
};
166166

167167
var _escapeable = /["\\\x00-\x1f\x7f-\x9f]/g;
168168

@@ -174,5 +174,5 @@
174174
'\r': '\\r',
175175
'"' : '\\"',
176176
'\\': '\\\\'
177-
}
177+
};
178178
})(jQuery);

jquery.json.min.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,20 @@ return $.toJSON(o.toJSON());if(o.constructor===Date)
1212
hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
1313
if(o.constructor===Array)
1414
{var ret=[];for(var i=0;i<o.length;i++)
15-
ret.push($.toJSON(o[i]));return"["+ret.join(",")+"]";}
15+
ret.push($.toJSON(o[i])||"null");return"["+ret.join(",")+"]";}
1616
var pairs=[];for(var k in o){var name;var type=typeof k;if(type=="number")
1717
name='"'+k+'"';else if(type=="string")
1818
name=$.quoteString(k);else
1919
continue;if(typeof o[k]=="function")
2020
continue;var val=$.toJSON(o[k]);pairs.push(name+":"+val);}
21-
return"{"+pairs.join(", ")+"}";}}
22-
$.evalJSON=function(src)
21+
return"{"+pairs.join(", ")+"}";}};$.evalJSON=function(src)
2322
{if(JSON&&JSON.parse)
24-
return JSON.parse(src);return eval("("+src+")");}
25-
$.secureEvalJSON=function(src)
23+
return JSON.parse(src);return eval("("+src+")");};$.secureEvalJSON=function(src)
2624
{if(JSON&&JSON.parse)
2725
return JSON.parse(src);var filtered=src;filtered=filtered.replace(/\\["\\\/bfnrtu]/g,'@');filtered=filtered.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']');filtered=filtered.replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered))
2826
return eval("("+src+")");else
2927
throw new SyntaxError("Error parsing JSON, source is not valid.");};$.quoteString=function(string)
3028
{if(_escapeable.test(string))
3129
{return'"'+string.replace(_escapeable,function(a)
32-
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"'}
33-
return'"'+string+'"';}
34-
var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'}})(jQuery);
30+
{var c=_meta[a];if(typeof c==='string')return c;c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
31+
return'"'+string+'"';};var _escapeable=/["\\\x00-\x1f\x7f-\x9f]/g;var _meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};})(jQuery);

0 commit comments

Comments
 (0)