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

Unified Diff: utils/apidoc/mdn/extract.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: utils/apidoc/mdn/extract.dart
diff --git a/utils/apidoc/mdn/extract.dart b/utils/apidoc/mdn/extract.dart
index 2e2d7660284508e3fcd0ed62152c10dc63c3a0ba..210e84cc208ecd3abd70afe226cc8eb10241e05e 100644
--- a/utils/apidoc/mdn/extract.dart
+++ b/utils/apidoc/mdn/extract.dart
@@ -3,8 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
import "dart:collection";
+import 'dart:convert';
import 'dart:html';
-import 'dart:json' as json;
// Workaround for HTML lib missing feature.
Range newRange() {
@@ -346,8 +346,8 @@ bool isSkippable(Node n) {
void onEnd() {
// Hideous hack to send JSON back to JS.
- String dbJson = json.stringify(dbEntry);
- // workaround bug in json.parse.
+ String dbJson = JSON.encode(dbEntry);
+ // workaround bug in JSON.decode.
dbJson = dbJson.replaceAll("ZDARTIUMDOESNTESCAPESLASHNJXXXX", "\\n");
// Use postMessage to end the JSON to JavaScript. TODO(jacobr): use a simple
@@ -1314,7 +1314,7 @@ void main() {
void documentLoaded(event) {
// Load the database of expected methods and properties with an HttpRequest.
new HttpRequest.get('${window.location}.json', (req) {
- data = json.parse(req.responseText);
+ data = JSON.decode(req.responseText);
dbEntry = {'members': [], 'srcUrl': pageUrl};
run();
});

Powered by Google App Engine
This is Rietveld 408576698