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

Unified Diff: utils/apidoc/mdn/util.dart

Issue 10889017: Repair bitrot in the utils/apidoc/mdn/ code. It now runs all the way through, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« utils/apidoc/mdn/extract.dart ('K') | « utils/apidoc/mdn/search.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/mdn/util.dart
===================================================================
--- utils/apidoc/mdn/util.dart (revision 11346)
+++ utils/apidoc/mdn/util.dart (working copy)
@@ -1,5 +1,6 @@
#library("util");
+#import("dart:io");
#import("dart:json");
Map<String, Map> _allProps;
@@ -7,7 +8,8 @@
Map<String, Map> get allProps() {
if (_allProps == null) {
// Database of expected property names for each type in WebKit.
- _allProps = JSON.parse(fs.readFileSync('data/dartIdl.json', 'utf8'));
+ _allProps = JSON.parse(
+ new File('data/dartIdl.json').readAsTextSync());
}
return _allProps;
}
@@ -82,3 +84,13 @@
}
return bestEntry;
}
+
+/**
+ * Helper for sync creation of a whole file from a string.
+ */
+void writeFileSync(String filename, String data) {
+ File f = new File(filename);
+ RandomAccessFile raf = f.openSync(FileMode.WRITE);
+ raf.writeStringSync(data);
+ raf.closeSync();
+}
« utils/apidoc/mdn/extract.dart ('K') | « utils/apidoc/mdn/search.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698