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

Side by Side Diff: utils/apidoc/mdn/util.dart

Issue 11412033: Rename File.readAsText to File.readAsString. There is no Text type in Dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/apidoc/mdn/prettyPrint.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library util; 1 library util;
2 2
3 import 'dart:io'; 3 import 'dart:io';
4 import 'dart:json'; 4 import 'dart:json';
5 5
6 Map<String, Map> _allProps; 6 Map<String, Map> _allProps;
7 7
8 Map<String, Map> get allProps { 8 Map<String, Map> get allProps {
9 if (_allProps == null) { 9 if (_allProps == null) {
10 // Database of expected property names for each type in WebKit. 10 // Database of expected property names for each type in WebKit.
11 _allProps = JSON.parse( 11 _allProps = JSON.parse(
12 new File('data/dartIdl.json').readAsTextSync()); 12 new File('data/dartIdl.json').readAsStringSync());
13 } 13 }
14 return _allProps; 14 return _allProps;
15 } 15 }
16 16
17 Set<String> matchedTypes; 17 Set<String> matchedTypes;
18 18
19 /** Returns whether the type has any member matching the specified name. */ 19 /** Returns whether the type has any member matching the specified name. */
20 bool hasAny(String type, String prop) { 20 bool hasAny(String type, String prop) {
21 final data = allProps[type]; 21 final data = allProps[type];
22 return data['properties'].containsKey(prop) || 22 return data['properties'].containsKey(prop) ||
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 87
88 /** 88 /**
89 * Helper for sync creation of a whole file from a string. 89 * Helper for sync creation of a whole file from a string.
90 */ 90 */
91 void writeFileSync(String filename, String data) { 91 void writeFileSync(String filename, String data) {
92 File f = new File(filename); 92 File f = new File(filename);
93 RandomAccessFile raf = f.openSync(FileMode.WRITE); 93 RandomAccessFile raf = f.openSync(FileMode.WRITE);
94 raf.writeStringSync(data); 94 raf.writeStringSync(data);
95 raf.closeSync(); 95 raf.closeSync();
96 } 96 }
OLDNEW
« no previous file with comments | « utils/apidoc/mdn/prettyPrint.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698