Index: sdk/lib/json/json_base.dart |
diff --git a/sdk/lib/json/json_base.dart b/sdk/lib/json/json_base.dart |
index 5432e5aa9bee90e43ae5cd46f516e3b70ae3b185..235a690f633163b2478dc9f5dac42d19026ccd2e 100644 |
--- a/sdk/lib/json/json_base.dart |
+++ b/sdk/lib/json/json_base.dart |
@@ -708,7 +708,7 @@ class _JsonStringifier { |
charCodes.add(charCode); |
} |
} |
- sb.add(needsEscape ? new String.fromCharCodes(charCodes) : s); |
+ sb.write(needsEscape ? new String.fromCharCodes(charCodes) : s); |
} |
void checkCycle(final object) { |
@@ -748,54 +748,54 @@ class _JsonStringifier { |
bool stringifyJsonValue(final object) { |
if (object is num) { |
// TODO: use writeOn. |
- sb.add(numberToString(object)); |
+ sb.write(numberToString(object)); |
return true; |
} else if (identical(object, true)) { |
- sb.add('true'); |
+ sb.write('true'); |
return true; |
} else if (identical(object, false)) { |
- sb.add('false'); |
+ sb.write('false'); |
return true; |
} else if (object == null) { |
- sb.add('null'); |
+ sb.write('null'); |
return true; |
} else if (object is String) { |
- sb.add('"'); |
+ sb.write('"'); |
escape(sb, object); |
- sb.add('"'); |
+ sb.write('"'); |
return true; |
} else if (object is List) { |
checkCycle(object); |
List a = object; |
- sb.add('['); |
+ sb.write('['); |
if (a.length > 0) { |
stringifyValue(a[0]); |
// TODO: switch to Iterables. |
for (int i = 1; i < a.length; i++) { |
- sb.add(','); |
+ sb.write(','); |
stringifyValue(a[i]); |
} |
} |
- sb.add(']'); |
+ sb.write(']'); |
seen.removeLast(); |
return true; |
} else if (object is Map) { |
checkCycle(object); |
Map<String, Object> m = object; |
- sb.add('{'); |
+ sb.write('{'); |
bool first = true; |
m.forEach((String key, Object value) { |
if (!first) { |
- sb.add(',"'); |
+ sb.write(',"'); |
} else { |
- sb.add('"'); |
+ sb.write('"'); |
} |
escape(sb, key); |
- sb.add('":'); |
+ sb.write('":'); |
stringifyValue(value); |
first = false; |
}); |
- sb.add('}'); |
+ sb.write('}'); |
seen.removeLast(); |
return true; |
} else { |