chore: dartfmt Dart code in the repo

This commit is contained in:
Kevin Moore
2015-05-08 19:51:19 -07:00
parent a5638a940c
commit 7844e3a275
27 changed files with 252 additions and 332 deletions
+7 -10
View File
@@ -33,8 +33,10 @@ class PromiseWrapper {
}
class ObservableWrapper {
static StreamSubscription subscribe(Stream s, Function onNext, [onError, onComplete]) {
return s.listen(onNext, onError: onError, onDone: onComplete, cancelOnError: true);
static StreamSubscription subscribe(Stream s, Function onNext,
[onError, onComplete]) {
return s.listen(onNext,
onError: onError, onDone: onComplete, cancelOnError: true);
}
static bool isObservable(obs) {
@@ -65,14 +67,10 @@ class EventEmitter extends Stream {
_controller = new StreamController.broadcast();
}
StreamSubscription listen(void onData(String line), {
void onError(Error error),
void onDone(),
bool cancelOnError }) {
StreamSubscription listen(void onData(String line),
{void onError(Error error), void onDone(), bool cancelOnError}) {
return _controller.stream.listen(onData,
onError: onError,
onDone: onDone,
cancelOnError: cancelOnError);
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}
void add(value) {
@@ -88,7 +86,6 @@ class EventEmitter extends Stream {
}
}
class _Completer {
final Completer c;
+10 -9
View File
@@ -6,15 +6,16 @@ library angular2.src.facade.browser;
import 'dart:js' show context;
export 'dart:html' show
document,
location,
window,
Element,
Node,
MouseEvent,
KeyboardEvent,
Event;
export 'dart:html'
show
document,
location,
window,
Element,
Node,
MouseEvent,
KeyboardEvent,
Event;
final _gc = context['gc'];
+7 -4
View File
@@ -70,7 +70,7 @@ class StringMapWrapper {
map[key] = value;
}
static void delete(Map m, k) {
m.remove(k);
m.remove(k);
}
static void forEach(Map m, fn(v, k)) {
m.forEach((k, v) => fn(v, k));
@@ -96,7 +96,8 @@ class ListWrapper {
static bool contains(List m, k) => m.contains(k);
static List map(list, fn(item)) => list.map(fn).toList();
static List filter(List list, bool fn(item)) => list.where(fn).toList();
static int indexOf(List list, value, [int startIndex = 0]) => list.indexOf(value, startIndex);
static int indexOf(List list, value, [int startIndex = 0]) =>
list.indexOf(value, startIndex);
static int lastIndexOf(List list, value, [int startIndex = null]) =>
list.lastIndexOf(value, startIndex == null ? list.length : startIndex);
static find(List list, bool fn(item)) =>
@@ -115,7 +116,9 @@ class ListWrapper {
l.add(e);
}
static List concat(List a, List b) {
return []..addAll(a)..addAll(b);
return []
..addAll(a)
..addAll(b);
}
static bool isList(l) => l is List;
static void insert(List l, int index, value) {
@@ -154,7 +157,7 @@ class ListWrapper {
l.removeRange(from, to);
return sub;
}
static void sort(List l, compareFn(a,b)) {
static void sort(List l, compareFn(a, b)) {
l.sort(compareFn);
}
+3 -2
View File
@@ -123,7 +123,8 @@ class RegExpWrapper {
static RegExp create(regExpStr, [String flags = '']) {
bool multiLine = flags.contains('m');
bool caseSensitive = !flags.contains('i');
return new RegExp(regExpStr, multiLine: multiLine, caseSensitive: caseSensitive);
return new RegExp(regExpStr,
multiLine: multiLine, caseSensitive: caseSensitive);
}
static Match firstMatch(RegExp regExp, String input) {
return regExp.firstMatch(input);
@@ -147,7 +148,7 @@ class _JSLikeMatch {
_JSLikeMatch(this._m);
String operator[](index) => _m[index];
String operator [](index) => _m[index];
int get index => _m.start;
int get length => _m.groupCount + 1;
}