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

Unified Diff: lib/dom/src/native_DOMImplementation.dart

Issue 10905018: Add print closure. (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 | « lib/dom/src/Timer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dom/src/native_DOMImplementation.dart
diff --git a/lib/dom/src/native_DOMImplementation.dart b/lib/dom/src/native_DOMImplementation.dart
index 61f9a4b50299a661df69efc8467de21fe9f8395f..d6a79b975626577fe7f591f911ddddddf192a996 100644
--- a/lib/dom/src/native_DOMImplementation.dart
+++ b/lib/dom/src/native_DOMImplementation.dart
@@ -32,12 +32,11 @@ class _Utils {
}
static window() native "Utils_window";
+ static print(String message) native "Utils_print";
static SendPort spawnDomFunctionImpl(Function topLevelFunction) native "Utils_spawnDomFunction";
static int _getNewIsolateId() native "Utils_getNewIsolateId";
}
-Utils_print(String message) native "Utils_print";
-
class _NPObject extends NativeFieldWrapperClass1 {
_NPObject();
static _NPObject retrieve(String key) native "NPObject_retrieve";
@@ -105,3 +104,11 @@ class _DOMStringMapImpl extends NativeFieldWrapperClass1 implements Map<String,
int get length() => Maps.length(this);
bool isEmpty() => Maps.isEmpty(this);
}
+
+get _printClosure => (s) {
+ try {
+ window.console.log(s);
+ } on Dynamic catch(_) {
+ _Utils.print(s);
+ }
+};
« no previous file with comments | « lib/dom/src/Timer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698