mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-05-07 23:17:02 +08:00
removing useless catch that causes troubles when FF throws exceptions within the loop but outside of the try/catch clause
This commit is contained in:
21
src/JSON.js
21
src/JSON.js
@@ -81,19 +81,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("}");
|
||||
|
||||
Reference in New Issue
Block a user