This would serve two purposes:
-
Provide the low-level system-time ala java's System.currentTimeMillis() or JavaScript's Date.now.
-
allow mocking of time in DateTime.now and Stopwatch:
class Clock {| class ProgressBar { | |
| ProgressBar(); | |
| Future<Duration> show(Stream<num> onProgress); | |
| stop(); | |
| } | |
| class ProgressController { | |
| StreamController _controller; |
| class VersionPart { | |
| final int index; | |
| final String _name; | |
| const VersionPart._(this.index, this._name); | |
| static const VersionPart major = const VersionPart(0, 'major'); | |
| static const VersionPart minor = const VersionPart(1, 'minor'); | |
| static const VersionPart patch = const VersionPart(2, 'patch'); |
| abstract class Generable<E> extends Iterable<E> { | |
| Generator<E> get iterator; | |
| } | |
| abstract class Generator<E> extends Iterator<E> { | |
| /// [yieldValue] is the value returned from the previous `yield` expression. | |
| bool moveNext([yieldValue]); | |
| /// Causes the previous `yield` expression to throw. | |
| void fail(e, StackTrace s); |
This would serve two purposes:
Provide the low-level system-time ala java's System.currentTimeMillis() or JavaScript's Date.now.
allow mocking of time in DateTime.now and Stopwatch:
class Clock {| import 'dart:async'; | |
| import 'package:unittest/unittest.dart'; | |
| import 'package:unittest/mock.dart'; | |
| cb() {} | |
| main() { |
| import 'dart:mirrors'; | |
| main() { | |
| print(reflectClass(Foo).declarations.keys.map(MirrorSystem.getName).join(' ')); | |
| } | |
| class Foo { | |
| static var sv1 = 1; | |
| static var sv2 = 2; |
| library intl.tool.cldr.ldml2json; | |
| import 'dart:io'; | |
| import 'dart:async'; | |
| import 'package:path/path.dart'; | |
| import 'util.dart'; | |
| /// Converts CLDR data to JSON | |
| main() { |
| // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| // for details. All rights reserved. Use of this source code is governed by a | |
| // BSD-style license that can be found in the LICENSE file. | |
| part of intl; | |
| /** | |
| * Bidi stands for Bi-directional text. | |
| * According to http://en.wikipedia.org/wiki/Bi-directional_text: | |
| * Bi-directional text is text containing text in both text directionalities, |
| The current dart:async getAttachedStackTrace could potentially be used for sync errors as well, in which case the API could move directly to the StackTrace class: | |
| class StackTrace { | |
| /// the [StackTrace] attached to the given [error] | |
| StackTrace.attachedTo(var error); | |
| /// attach the current [StackTrace] to the given [error]. | |
| static void attach(var error); | |
| //... | |
| } |