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

Unified Diff: sdk/lib/_internal/pub/lib/src/source/hosted.dart

Issue 23596007: Remove usage of dart:json. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. 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/pub/lib/src/source/hosted.dart
diff --git a/sdk/lib/_internal/pub/lib/src/source/hosted.dart b/sdk/lib/_internal/pub/lib/src/source/hosted.dart
index 7a0409f741dcfed61fd020048ec880d2296f98f1..b2c1647cebab86b4979bcbf9f65934f9a5a8e4fe 100644
--- a/sdk/lib/_internal/pub/lib/src/source/hosted.dart
+++ b/sdk/lib/_internal/pub/lib/src/source/hosted.dart
@@ -6,7 +6,7 @@ library pub.source.hosted;
import 'dart:async';
import 'dart:io' as io;
-import 'dart:json' as json;
+import "dart:convert";
import 'package:http/http.dart' as http;
import 'package:path/path.dart' as path;
@@ -46,7 +46,7 @@ class HostedSource extends Source {
log.io("Get versions from $url.");
return httpClient.read(url, headers: PUB_API_HEADERS).then((body) {
- var doc = json.parse(body);
+ var doc = JSON.decode(body);
return doc['versions']
.map((version) => new Version.parse(version['version']))
.toList();
@@ -65,7 +65,7 @@ class HostedSource extends Source {
log.io("Describe package at $url.");
return httpClient.read(url, headers: PUB_API_HEADERS).then((version) {
- version = json.parse(version);
+ version = JSON.decode(version);
// TODO(rnystrom): After this is pulled down, we could place it in
// a secondary cache of just pubspecs. This would let us have a

Powered by Google App Engine
This is Rietveld 408576698