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

Unified Diff: tools/coverage.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: tools/coverage.dart
diff --git a/tools/coverage.dart b/tools/coverage.dart
index 678fe5743010d3d4e78bc6c45f7a6db697002eff..34018c5482e4289546616507006cfd39b0ab80e0 100644
--- a/tools/coverage.dart
+++ b/tools/coverage.dart
@@ -15,7 +15,6 @@
import "dart:convert";
import "dart:io";
-import "dart:json" as JSON;
// Whether or not to print debug target process on the console.
@@ -311,7 +310,7 @@ class Debugger {
cleanup();
return;
}
- var msgObj = JSON.parse(msg);
+ var msgObj = JSON.decode(msg);
handleMessage(msgObj);
if (errorsDetected) {
error("Error while handling message from coverage target");
@@ -343,7 +342,7 @@ class Debugger {
void sendMessage(Map<String,dynamic> msg) {
assert(msg["id"] != null);
msg["id"] = nextMessageId++;
- String jsonMsg = JSON.stringify(msg);
+ String jsonMsg = JSON.encode(msg);
if (verboseWire) print("SEND: $jsonMsg");
socket.write(jsonMsg);
}
@@ -481,7 +480,7 @@ class JsonBuffer {
// buffer, or 0 if there is only a partial message in the buffer.
// The object value must start with '{' and continues to the
// matching '}'. No attempt is made to otherwise validate the contents
- // as JSON. If it is invalid, a later JSON.parse() will fail.
+ // as JSON. If it is invalid, a later JSON.decode() will fail.
int objectLength() {
int skipWhitespace(int index) {
while (index < buffer.length) {

Powered by Google App Engine
This is Rietveld 408576698