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

Side by Side Diff: dart/frog/leg/lib/mockimpl.dart

Issue 9355031: Improve List implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased and resolved conflicts 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/frog/leg/lib/mock.dart ('k') | dart/frog/leg/scanner/scanner.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Mocks of classes and interfaces that Leg cannot read directly. 5 // Mocks of classes and interfaces that Leg cannot read directly.
6 6
7 // TODO(ahe): Remove this file. 7 // TODO(ahe): Remove this file.
8 8
9 class JSSyntaxRegExp implements RegExp { 9 class JSSyntaxRegExp implements RegExp {
10 JSSyntaxRegExp(String pattern, 10 JSSyntaxRegExp(String pattern,
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 } else { 477 } else {
478 equivalentYear = years; 478 equivalentYear = years;
479 offsetInSeconds = 0; 479 offsetInSeconds = 0;
480 } 480 }
481 int secondsSinceEpoch = Primitives.brokenDownDateToSecondsSinceEpoch( 481 int secondsSinceEpoch = Primitives.brokenDownDateToSecondsSinceEpoch(
482 equivalentYear, month, day, hours, minutes, seconds, isUtc); 482 equivalentYear, month, day, hours, minutes, seconds, isUtc);
483 int adjustedSeconds = secondsSinceEpoch + offsetInSeconds; 483 int adjustedSeconds = secondsSinceEpoch + offsetInSeconds;
484 return adjustedSeconds * Duration.MILLISECONDS_PER_SECOND + milliseconds; 484 return adjustedSeconds * Duration.MILLISECONDS_PER_SECOND + milliseconds;
485 } 485 }
486 } 486 }
487
488 class ListFactory<E> implements List<E> {
489 factory List([int length]) => Primitives.newList(length);
490 factory List.from(Iterable<E> other) {
491 List<E> result = new List<E>();
492 // TODO(ahe): Use for-in when it is implemented correctly.
493 Iterator<E> iterator = other.iterator();
494 while (iterator.hasNext()) {
495 result.add(iterator.next());
496 }
497 return result;
498 }
499 }
OLDNEW
« no previous file with comments | « dart/frog/leg/lib/mock.dart ('k') | dart/frog/leg/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698