| OLD | NEW |
| 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 dart2js.code_output; | 5 library dart2js.code_output; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'source_information.dart'; | 9 import 'source_information.dart'; |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 /// | 32 /// |
| 33 /// If the output is closed, a [StateError] is thrown. | 33 /// If the output is closed, a [StateError] is thrown. |
| 34 void add(String text); | 34 void add(String text); |
| 35 | 35 |
| 36 /// Adds the content of [buffer] to the output and adds its markers to | 36 /// Adds the content of [buffer] to the output and adds its markers to |
| 37 /// [markers]. | 37 /// [markers]. |
| 38 /// | 38 /// |
| 39 /// If the output is closed, a [StateError] is thrown. | 39 /// If the output is closed, a [StateError] is thrown. |
| 40 void addBuffer(CodeBuffer buffer); | 40 void addBuffer(CodeBuffer buffer); |
| 41 | 41 |
| 42 /// Returns the number of characters currently write to this output. | 42 /// Returns the number of characters currently written to this output. |
| 43 int get length; | 43 int get length; |
| 44 | 44 |
| 45 /// Returns `true` if this output has been closed. | 45 /// Returns `true` if this output has been closed. |
| 46 bool get isClosed; | 46 bool get isClosed; |
| 47 | 47 |
| 48 /// Closes the output. Further writes will cause a [StateError]. | 48 /// Closes the output. Further writes will cause a [StateError]. |
| 49 void close(); | 49 void close(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 abstract class AbstractCodeOutput extends CodeOutput { | 52 abstract class AbstractCodeOutput extends CodeOutput { |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 void close() { | 147 void close() { |
| 148 output.close(); | 148 output.close(); |
| 149 super.close(); | 149 super.close(); |
| 150 if (_listeners != null) { | 150 if (_listeners != null) { |
| 151 _listeners.forEach((listener) => listener.onDone(length)); | 151 _listeners.forEach((listener) => listener.onDone(length)); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 } | 154 } |
| OLD | NEW |