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

Side by Side Diff: sdk/lib/io/console.dart

Issue 739153002: Make the ConsoleSink call methos argument optional. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | « no previous file | tests/standalone/io/console_script.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 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart.io; 5 part of dart.io;
6 6
7 Console _console; 7 Console _console;
8 8
9 Console get console { 9 Console get console {
10 if (_console == null) { 10 if (_console == null) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 * This class has a call method so you can call it directly. Calling 44 * This class has a call method so you can call it directly. Calling
45 * it directly is the same as calling its `writeln` method. 45 * it directly is the same as calling its `writeln` method.
46 */ 46 */
47 class ConsoleSink implements Sink<List<int>>, StringSink { 47 class ConsoleSink implements Sink<List<int>>, StringSink {
48 IOSink _sink; 48 IOSink _sink;
49 49
50 ConsoleSink._(int fd) { 50 ConsoleSink._(int fd) {
51 _sink = new IOSink(new _ConsoleConsumer(fd)); 51 _sink = new IOSink(new _ConsoleConsumer(fd));
52 } 52 }
53 53
54 void call(Object message) => _sink.writeln(message); 54 void call([Object message = ""]) => _sink.writeln(message);
55 55
56 void add(List<int> data) => _sink.add(data); 56 void add(List<int> data) => _sink.add(data);
57 57
58 void close() {} 58 void close() {}
59 59
60 void write(Object obj) => _sink.write(obj); 60 void write(Object obj) => _sink.write(obj);
61 61
62 void writeAll(Iterable objects, [String separator=""]) => 62 void writeAll(Iterable objects, [String separator=""]) =>
63 _sink.writeAll(objects, separator); 63 _sink.writeAll(objects, separator);
64 64
(...skipping 23 matching lines...) Expand all
88 onDone: completer.complete, 88 onDone: completer.complete,
89 cancelOnError: true); 89 cancelOnError: true);
90 return completer.future; 90 return completer.future;
91 } 91 }
92 92
93 Future close() { 93 Future close() {
94 _file.closeSync(); 94 _file.closeSync();
95 return new Future.value(); 95 return new Future.value();
96 } 96 }
97 } 97 }
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/console_script.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698