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

Unified Diff: pkg/oauth2/lib/src/handle_access_token_response.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: pkg/oauth2/lib/src/handle_access_token_response.dart
diff --git a/pkg/oauth2/lib/src/handle_access_token_response.dart b/pkg/oauth2/lib/src/handle_access_token_response.dart
index c14b8d1e2a697fff3d5a87ce11a8c974bd812d75..129f259194bfdb4a61881504fc0b015683c73590 100644
--- a/pkg/oauth2/lib/src/handle_access_token_response.dart
+++ b/pkg/oauth2/lib/src/handle_access_token_response.dart
@@ -5,7 +5,7 @@
library handle_access_token_response;
import 'dart:io';
-import 'dart:json' as JSON;
+import 'dart:convert';
import 'package:http/http.dart' as http;
@@ -39,7 +39,7 @@ Credentials handleAccessTokenResponse(
var parameters;
try {
- parameters = JSON.parse(response.body);
+ parameters = JSON.decode(response.body);
} on FormatException catch (e) {
validate(false, 'invalid JSON');
}
@@ -108,7 +108,7 @@ void _handleErrorResponse(http.Response response, Uri tokenEndpoint) {
var parameters;
try {
- parameters = JSON.parse(response.body);
+ parameters = JSON.decode(response.body);
} on FormatException catch (e) {
validate(false, 'invalid JSON');
}

Powered by Google App Engine
This is Rietveld 408576698