aboutsummaryrefslogtreecommitdiffstats
path: root/src/JSON.js
diff options
context:
space:
mode:
authorMisko Hevery2010-09-14 23:42:43 +0200
committerMisko Hevery2010-09-14 23:42:43 +0200
commit2a3a449c6d55cf41a9ceb76608438c0488cbe3c0 (patch)
tree4080dbbaeadab70dee96f9daa1175148924eee2c /src/JSON.js
parent894ffadc8c35da6c7daf3e16a9f4931b24f3b231 (diff)
parentd8e86291c4a92395988f50d883200cdab12f726e (diff)
downloadangular.js-2a3a449c6d55cf41a9ceb76608438c0488cbe3c0.tar.bz2
merge
Diffstat (limited to 'src/JSON.js')
-rw-r--r--src/JSON.js21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/JSON.js b/src/JSON.js
index 6fb43f0f..9fb325ef 100644
--- a/src/JSON.js
+++ b/src/JSON.js
@@ -77,19 +77,16 @@ function toJsonArray(buf, obj, pretty, stack){
keys.sort();
for ( var keyIndex = 0; keyIndex < keys.length; keyIndex++) {
var key = keys[keyIndex];
- try {
- var value = obj[key];
- if (typeof value != $function) {
- if (comma) {
- buf.push(",");
- if (pretty) buf.push(pretty);
- }
- buf.push(angular['String']['quote'](key));
- buf.push(":");
- toJsonArray(buf, value, childPretty, stack);
- comma = true;
+ var value = obj[key];
+ if (typeof value != $function) {
+ if (comma) {
+ buf.push(",");
+ if (pretty) buf.push(pretty);
}
- } catch (e) {
+ buf.push(angular['String']['quote'](key));
+ buf.push(":");
+ toJsonArray(buf, value, childPretty, stack);
+ comma = true;
}
}
buf.push("}");