| 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 typedef void _PrintClosure(Object obj); | 5 // A print-closure gets a String that should be printed. In general the |
| 6 // string is a line, but it may contain "\n" characters. |
| 7 typedef void _PrintClosure(String line); |
| 6 | 8 |
| 7 patch void printToConsole(String line) { | 9 patch void printToConsole(String line) { |
| 8 _printClosure(line); | 10 _printClosure(line); |
| 9 } | 11 } |
| 10 | 12 |
| 11 void _unsupportedPrint(Object obj) { | 13 void _unsupportedPrint(String line) { |
| 12 throw new UnsupportedError("'print' is not supported"); | 14 throw new UnsupportedError("'print' is not supported"); |
| 13 } | 15 } |
| 14 | 16 |
| 15 // _printClosure can be overwritten by the embedder to supply a different | 17 // _printClosure can be overwritten by the embedder to supply a different |
| 16 // print implementation. | 18 // print implementation. |
| 17 _PrintClosure _printClosure = _unsupportedPrint; | 19 _PrintClosure _printClosure = _unsupportedPrint; |
| OLD | NEW |