Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9899959

Browse files
author
iminar
committed
removing useless catch that causes troubles when FF throws exceptions within the loop but outside of the try/catch clause
1 parent 7159b30 commit 9899959

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/JSON.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,16 @@ function toJsonArray(buf, obj, pretty, stack){
8181
keys.sort();
8282
for ( var keyIndex = 0; keyIndex < keys.length; keyIndex++) {
8383
var key = keys[keyIndex];
84-
try {
85-
var value = obj[key];
86-
if (typeof value != 'function') {
87-
if (comma) {
88-
buf.push(",");
89-
if (pretty) buf.push(pretty);
90-
}
91-
buf.push(angular['String']['quote'](key));
92-
buf.push(":");
93-
toJsonArray(buf, value, childPretty, stack);
94-
comma = true;
84+
var value = obj[key];
85+
if (typeof value != 'function') {
86+
if (comma) {
87+
buf.push(",");
88+
if (pretty) buf.push(pretty);
9589
}
96-
} catch (e) {
90+
buf.push(angular['String']['quote'](key));
91+
buf.push(":");
92+
toJsonArray(buf, value, childPretty, stack);
93+
comma = true;
9794
}
9895
}
9996
buf.push("}");

0 commit comments

Comments
 (0)