| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #library("dart:core"); | 5 #library("dart:core"); |
| 6 #import("dart:coreimpl"); | 6 #import("dart:coreimpl"); |
| 7 | 7 |
| 8 // TODO(jimhug): Better way to map in standard corelib | 8 // TODO(jimhug): Better way to map in standard corelib |
| 9 #source("../../corelib/src/bool.dart"); | 9 #source("../../corelib/src/bool.dart"); |
| 10 #source("../../corelib/src/collection.dart"); | 10 #source("../../corelib/src/collection.dart"); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 /** Returns the current clock tick. */ | 49 /** Returns the current clock tick. */ |
| 50 static int now() native 'return new Date().getTime();'; | 50 static int now() native 'return new Date().getTime();'; |
| 51 | 51 |
| 52 /** Returns the frequency of clock ticks in Hz. */ | 52 /** Returns the frequency of clock ticks in Hz. */ |
| 53 // TODO(jimhug): Why isn't this a property? | 53 // TODO(jimhug): Why isn't this a property? |
| 54 static int frequency() => 1000; | 54 static int frequency() => 1000; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // TODO(jmesserly): this is working around a name conflict with "window.print". | 57 // TODO(jmesserly): this is working around a name conflict with "window.print". |
| 58 void print(Object obj) => _print(obj); | 58 void print(Object obj) => _print(obj); |
| 59 void _print(Object obj) native '''if (typeof console == 'object') { | 59 void _print(Object obj) native @'''if (typeof console == 'object') { |
| 60 if (obj) obj = obj.toString(); | 60 if (obj) obj = obj.toString(); |
| 61 console.log(obj); | 61 console.log(obj); |
| 62 } else { | 62 } else { |
| 63 write(obj); | 63 write(obj); |
| 64 write('\n'); | 64 write('\n'); |
| 65 }''' { | 65 }''' { |
| 66 // ensure toString is generated | 66 // ensure toString is generated |
| 67 obj.toString(); | 67 obj.toString(); |
| 68 } | 68 } |
| 69 | 69 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 | 139 |
| 140 ImmutableMap _constMap(List itemsAndKeys) { | 140 ImmutableMap _constMap(List itemsAndKeys) { |
| 141 return new ImmutableMap(itemsAndKeys); | 141 return new ImmutableMap(itemsAndKeys); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void _assert(var test, String text, String url, int line, int column) { | 144 void _assert(var test, String text, String url, int line, int column) { |
| 145 if (test is Function) test = test(); | 145 if (test is Function) test = test(); |
| 146 if (!test) throw new AssertionError._internal(text, url, line, column); | 146 if (!test) throw new AssertionError._internal(text, url, line, column); |
| 147 } | 147 } |
| OLD | NEW |