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

Unified Diff: frog/lib/corelib.dart

Issue 8775027: Frog now knows about the JS global object, and prevents name collisions with user code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 | « frog/frogsh ('k') | frog/type.dart » ('j') | frog/type.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/lib/corelib.dart
diff --git a/frog/lib/corelib.dart b/frog/lib/corelib.dart
index 49de1cbf2aec672a89f4226dd1b13e54f6062c6d..12c690de0b978516da386d30fb5824ce95b9c574 100644
--- a/frog/lib/corelib.dart
+++ b/frog/lib/corelib.dart
@@ -51,10 +51,12 @@ class Clock {
/** Returns the frequency of clock ticks in Hz. */
// TODO(jimhug): Why isn't this a property?
- static int frequency() native 'return 1000;';
+ static int frequency() => 1000;
}
-void print(Object obj) native '''if (typeof console == 'object') {
+// TODO(jmesserly): this is working around a name conflict with "window.print".
+void print(Object obj) => _print(obj);
+void _print(Object obj) native '''if (typeof console == 'object') {
if (obj) obj = obj.toString();
console.log(obj);
} else {
« no previous file with comments | « frog/frogsh ('k') | frog/type.dart » ('j') | frog/type.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698