Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2392)

Unified Diff: sdk/lib/_internal/lib/convert_patch.dart

Issue 23554004: Made old dart:json library use convert to parse JSON. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/lib/convert_patch.dart
diff --git a/sdk/lib/_internal/lib/json_patch.dart b/sdk/lib/_internal/lib/convert_patch.dart
similarity index 94%
rename from sdk/lib/_internal/lib/json_patch.dart
rename to sdk/lib/_internal/lib/convert_patch.dart
index ad22ae7d1aa4d8f71b957e8076a147f697bce517..5fc2014adf4e6e1bd740472d795aa33f59f93220 100644
--- a/sdk/lib/_internal/lib/json_patch.dart
+++ b/sdk/lib/_internal/lib/convert_patch.dart
@@ -23,14 +23,14 @@ import 'dart:_interceptors' show JSExtendableArray;
*
* Throws [FormatException] if the input is not valid JSON text.
*/
-patch parse(String json, [reviver(var key, var value)]) {
- if (json is! String) throw new ArgumentError(json);
+patch _parseJson(String source, reviver(var key, var value)) {
+ if (source is! String) throw new ArgumentError(source);
var parsed;
try {
parsed = JS('=Object|JSExtendableArray|Null|bool|num|String',
'JSON.parse(#)',
- json);
+ source);
} catch (e) {
throw new FormatException(JS('String', 'String(#)', e));
}
@@ -90,5 +90,5 @@ _convertJsonToDart(json, reviver(key, value)) {
return map;
}
- return revive('', walk(json));
+ return revive(null, walk(json));
floitsch 2013/08/27 13:25:40 Let's do this change in a separate CL. Otherwise i
Lasse Reichstein Nielsen 2013/08/28 08:02:59 Done.
}

Powered by Google App Engine
This is Rietveld 408576698