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

Unified Diff: runtime/lib/print_patch.dart

Issue 10887024: Move print to corelib. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/print.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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";
+
+ // _printClosure can be overwritten by the embedder to supply a different
+ // print implementation.
+ static _PrintClosure _printClosure = _print;
Anders Johnsen 2012/08/29 12:39:21 Very clean, nice!
+}
« no previous file with comments | « runtime/lib/print.cc ('k') | runtime/vm/bootstrap_natives.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698