Chromium Code Reviews| Index: runtime/lib/print_patch.dart |
| diff --git a/runtime/lib/print_patch.dart b/runtime/lib/print_patch.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0ae0c6cd645b62ef199fd8e91b6b3be364b3b45f |
| --- /dev/null |
| +++ b/runtime/lib/print_patch.dart |
| @@ -0,0 +1,18 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| + |
| +typedef void _PrintClosure(Object obj); |
| + |
| +patch class PrintImplementation { |
| + /* patch */ static void print(Object obj) { |
| + _printClosure(obj.toString()); |
| + } |
| + |
| + static void _print(Object obj) native "PrintImplementation_printString"; |
|
Ivan Posva
2012/08/30 00:32:13
This closure belongs into the builtin library.
Mads Ager (google)
2012/08/30 06:59:17
Got it. I can move it back to builtin and do the p
|
| + |
| + // _printClosure can be overwritten by the embedder to supply a different |
| + // print implementation. |
| + static _PrintClosure _printClosure = _print; |
|
Ivan Posva
2012/08/30 00:32:13
And we should initialize the _printClosure with so
Mads Ager (google)
2012/08/30 06:59:17
We can do that. I actually liked the fact that emb
|
| +} |