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

Unified Diff: dart/frog/leg/lib/core.dart

Issue 9420001: Various mocks and tweaks to reduce cancels in Leg. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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 | « no previous file | dart/frog/leg/lib/coreimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/lib/core.dart
diff --git a/dart/frog/leg/lib/core.dart b/dart/frog/leg/lib/core.dart
index 7e837b5638b4023fdcab22d54619bb24fe2060ed..4009cddf94359c801762c74580079f1c13fc2fd7 100644
--- a/dart/frog/leg/lib/core.dart
+++ b/dart/frog/leg/lib/core.dart
@@ -38,6 +38,7 @@
#source('../../../corelib/src/string_buffer.dart');
#source('../../../corelib/src/strings.dart');
#source('../../../corelib/src/time_zone.dart');
+#source('mock.dart');
void print(var obj) => Primitives.printString(obj.toString());
@@ -48,67 +49,3 @@ class Object {
throw new NoSuchMethodException(this, name, args);
}
}
-
-class NoSuchMethodException {
- Object receiver;
- String name;
- List args;
- NoSuchMethodException(Object this.receiver, String this.name, List this.args);
- String toString() {
- return "NoSuchMethodException - receiver: '$receiver'" +
- "function name: '$name' arguments: [$args]";
- }
-}
-
-class List<T> implements Iterable<T> {
- factory List([int length]) => Primitives.newList(length);
-}
-
-interface Exception {}
-
-class Stopwatch {
- double startMs;
- double elapsedMs;
-
- Stopwatch() {
- elapsedMs = 0.0;
- }
-
- void start() {
- if (startMs == null) {
- startMs = Primitives.dateNow();
- }
- }
-
- void stop() {
- if (startMs == null) return;
- elapsedMs += Primitives.dateNow() - startMs;
- startMs = null;
- }
-
- void reset() {
- elapsedMs = 0.0;
- if (startMs == null) return;
- startMs = Primitives.dateNow();
- }
-
- int elapsed() {
- return elapsedInMs();
- }
-
- int elapsedInUs() {
- return elapsedInMs() * 1000;
- }
-
- int elapsedInMs() {
- if (startMs == null) {
- return Primitives.mathFloor(elapsedMs);
- } else {
- return Primitives.mathFloor(elapsedMs + (Primitives.dateNow() - startMs));
- }
- }
-
- int frequency() {
- return 1000;
- }
-}
« no previous file with comments | « no previous file | dart/frog/leg/lib/coreimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698