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

Side by Side Diff: lib/src/file_system/console.dart

Issue 55143003: webui fixes for 0.8.9 (Closed) Base URL: git@github.com:dart-lang/web-ui.git@master
Patch Set: Created 7 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library console; 5 library console;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:convert';
8 import 'dart:io'; 9 import 'dart:io';
9 import 'dart:utf';
10 import 'package:web_ui/src/file_system.dart'; 10 import 'package:web_ui/src/file_system.dart';
11 11
12 /** File system implementation for console VM (i.e. no browser). */ 12 /** File system implementation for console VM (i.e. no browser). */
13 class ConsoleFileSystem implements FileSystem { 13 class ConsoleFileSystem implements FileSystem {
14 14
15 /** Pending futures for file write requests. */ 15 /** Pending futures for file write requests. */
16 final _pending = <String, Future>{}; 16 final _pending = <String, Future>{};
17 17
18 Future flush() => Future.wait(_pending.values.toList()); 18 Future flush() => Future.wait(_pending.values.toList());
19 19
(...skipping 15 matching lines...) Expand all
35 // TODO(jmesserly): is this guaranteed to read all of the bytes? 35 // TODO(jmesserly): is this guaranteed to read all of the bytes?
36 var buffer = new List<int>(length); 36 var buffer = new List<int>(length);
37 return file.readInto(buffer, 0, length) 37 return file.readInto(buffer, 0, length)
38 .then((_) => file.close()) 38 .then((_) => file.close())
39 .then((_) => buffer); 39 .then((_) => buffer);
40 })); 40 }));
41 } 41 }
42 42
43 // TODO(jmesserly): do we support any encoding other than UTF-8 for Dart? 43 // TODO(jmesserly): do we support any encoding other than UTF-8 for Dart?
44 Future<String> readText(String path) { 44 Future<String> readText(String path) {
45 return readTextOrBytes(path).then(decodeUtf8); 45 return readTextOrBytes(path).then(UTF8.decode);
46 } 46 }
47 } 47 }
OLDNEW
« no previous file with comments | « lib/src/dart_parser.dart ('k') | lib/src/info.dart » ('j') | pubspec.yaml » ('J')

Powered by Google App Engine
This is Rietveld 408576698