Skip to content

Commit ffb219f

Browse files
author
Tim Blasi
committed
style(dart): Format Dart source with dart_style 0.1.8
1 parent eb2784e commit ffb219f

17 files changed

Lines changed: 190 additions & 171 deletions

modules/angular2/angular2_sfx.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
library angular2.sfx;
2-
// empty as we don't have a version for Dart
2+
3+
// empty as we don't have a version for Dart

modules/angular2/src/core/compiler/directive_lifecycle_reflector.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,16 @@ bool hasLifecycleHook(LifecycleEvent e, type, Directive annotation) {
1313

1414
if (e == onChange) {
1515
interface = OnChange;
16-
1716
} else if (e == onDestroy) {
1817
interface = OnDestroy;
19-
2018
} else if (e == onAllChangesDone) {
2119
interface = OnAllChangesDone;
22-
2320
} else if (e == onCheck) {
2421
interface = OnCheck;
25-
2622
} else if (e == onInit) {
2723
interface = OnInit;
2824
}
2925

3026
return interfaces.contains(interface);
3127
}
32-
}
28+
}

modules/angular2/src/core/zone/ng_zone.dart

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,13 @@ class NgZone {
5252
_mountZone = Zone.current;
5353

5454
if (enableLongStackTrace) {
55-
_innerZone = Chain.capture(
56-
() => _createInnerZone(Zone.current),
55+
_innerZone = Chain.capture(() => _createInnerZone(Zone.current),
5756
onError: _onErrorWithLongStackTrace);
5857
} else {
59-
_innerZone = _createInnerZone(
60-
Zone.current,
61-
handleUncaughtError: (Zone self, ZoneDelegate parent, Zone zone, error, StackTrace trace) =>
62-
_onErrorWithoutLongStackTrace(error, trace)
63-
);
58+
_innerZone = _createInnerZone(Zone.current,
59+
handleUncaughtError: (Zone self, ZoneDelegate parent, Zone zone,
60+
error,
61+
StackTrace trace) => _onErrorWithoutLongStackTrace(error, trace));
6462
}
6563
}
6664

@@ -75,7 +73,8 @@ class NgZone {
7573
* @param {Function} onTurnDone called at the end of a VM turn if code has executed in the inner zone
7674
* @param {Function} onErrorHandler called when an exception is thrown by a macro or micro task
7775
*/
78-
void initCallbacks({Function onTurnStart, Function onTurnDone, Function onErrorHandler}) {
76+
void initCallbacks(
77+
{Function onTurnStart, Function onTurnDone, Function onErrorHandler}) {
7978
_onTurnStart = onTurnStart;
8079
_onTurnDone = onTurnDone;
8180
_onErrorHandler = onErrorHandler;
@@ -158,10 +157,10 @@ class NgZone {
158157
}
159158

160159
dynamic _runUnary(Zone self, ZoneDelegate parent, Zone zone, fn(arg), arg) =>
161-
_run(self, parent, zone, () => fn(arg));
160+
_run(self, parent, zone, () => fn(arg));
162161

163-
dynamic _runBinary(Zone self, ZoneDelegate parent, Zone zone, fn(arg1, arg2), arg1, arg2) =>
164-
_run(self, parent, zone, () => fn(arg1, arg2));
162+
dynamic _runBinary(Zone self, ZoneDelegate parent, Zone zone, fn(arg1, arg2),
163+
arg1, arg2) => _run(self, parent, zone, () => fn(arg1, arg2));
165164

166165
void _scheduleMicrotask(Zone self, ZoneDelegate parent, Zone zone, fn) {
167166
_pendingMicrotasks++;
@@ -196,14 +195,12 @@ class NgZone {
196195

197196
Zone _createInnerZone(Zone zone, {handleUncaughtError}) {
198197
return zone.fork(
199-
specification: new ZoneSpecification(
200-
scheduleMicrotask: _scheduleMicrotask,
201-
run: _run,
202-
runUnary: _runUnary,
203-
runBinary: _runBinary,
204-
handleUncaughtError: handleUncaughtError
205-
),
206-
zoneValues: {'_innerZone': true}
207-
);
198+
specification: new ZoneSpecification(
199+
scheduleMicrotask: _scheduleMicrotask,
200+
run: _run,
201+
runUnary: _runUnary,
202+
runBinary: _runBinary,
203+
handleUncaughtError: handleUncaughtError),
204+
zoneValues: {'_innerZone': true});
208205
}
209206
}

modules/angular2/src/dom/browser_adapter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
135135
MouseEvent createMouseEvent(String eventType) =>
136136
new MouseEvent(eventType, canBubble: true);
137137
Event createEvent(String eventType) => new Event(eventType, canBubble: true);
138-
void preventDefault(Event evt) {
138+
void preventDefault(Event evt) {
139139
evt.preventDefault();
140140
}
141141
String getInnerHTML(Element el) => el.innerHtml;

modules/angular2/src/dom/html_adapter.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Html5LibDomAdapter implements DomAdapter {
7676
createEvent(eventType) {
7777
throw 'not implemented';
7878
}
79-
preventDefault(evt) {
79+
preventDefault(evt) {
8080
throw 'not implemented';
8181
}
8282
getInnerHTML(el) {

modules/angular2/src/facade/async.dart

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ export 'dart:async' show Future, Stream, StreamController, StreamSubscription;
66
class PromiseWrapper {
77
static Future resolve(obj) => new Future.value(obj);
88

9-
static Future reject(obj, stackTrace) => new Future.error(
10-
obj,
11-
stackTrace != null
12-
? stackTrace
13-
: obj is Error
14-
? obj.stackTrace
15-
: null);
9+
static Future reject(obj, stackTrace) => new Future.error(obj,
10+
stackTrace != null ? stackTrace : obj is Error ? obj.stackTrace : null);
1611

1712
static Future<List> all(List<Future> promises) => Future.wait(promises);
1813

@@ -35,15 +30,17 @@ class PromiseWrapper {
3530
}
3631

3732
class TimerWrapper {
38-
static Timer setTimeout(fn(), int millis)
39-
=> new Timer(new Duration(milliseconds: millis), fn);
33+
static Timer setTimeout(fn(), int millis) =>
34+
new Timer(new Duration(milliseconds: millis), fn);
4035
static void clearTimeout(Timer timer) {
4136
timer.cancel();
4237
}
4338

4439
static Timer setInterval(fn(), int millis) {
4540
var interval = new Duration(milliseconds: millis);
46-
return new Timer.periodic(interval, (Timer timer) { fn(); });
41+
return new Timer.periodic(interval, (Timer timer) {
42+
fn();
43+
});
4744
}
4845
static void clearInterval(Timer timer) {
4946
timer.cancel();

modules/angular2/src/reflection/reflection_capabilities.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ class ReflectionCapabilities {
5757

5858
List _convertParameter(ParameterMirror p) {
5959
var t = p.type;
60-
var res = (!t.hasReflectedType || t.reflectedType == dynamic) ? [] : [t.reflectedType];
60+
var res = (!t.hasReflectedType || t.reflectedType == dynamic)
61+
? []
62+
: [t.reflectedType];
6163
res.addAll(p.metadata.map((m) => m.reflectee));
6264
return res;
6365
}

modules/angular2/src/services/xhr_impl.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ import './xhr.dart' show XHR;
88
@Injectable()
99
class XHRImpl extends XHR {
1010
Future<String> get(String url) {
11-
12-
return HttpRequest
13-
.request(url)
14-
.then((HttpRequest req) => req.responseText,
15-
onError: (_) => new Future.error('Failed to load $url'));
11+
return HttpRequest.request(url).then((HttpRequest req) => req.responseText,
12+
onError: (_) => new Future.error('Failed to load $url'));
1613
}
1714
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
library angular2.e2e_util;
2-
// empty as this file is node.js specific and should not be transpiled to dart
2+
3+
// empty as this file is node.js specific and should not be transpiled to dart

modules/angular2/src/test_lib/fake_async.dart

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,33 @@ Function fakeAsync(Function fn) {
2424
}
2525

2626
return ([a0 = _u, a1 = _u, a2 = _u, a3 = _u, a4 = _u, a5 = _u, a6 = _u,
27-
a7 = _u, a8 = _u, a9 = _u]) {
27+
a7 = _u, a8 = _u, a9 = _u]) {
2828
// runZoned() to install a custom exception handler that re-throws
2929
return runZoned(() {
3030
new quiver.FakeAsync().run((quiver.FakeAsync async) {
3131
try {
3232
_fakeAsync = async;
33-
List args = [a0, a1, a2, a3, a4, a5, a6, a7, a8, a9]
34-
.takeWhile((a) => a != _u).toList();
35-
return Function.apply(fn , args);
33+
List args = [
34+
a0,
35+
a1,
36+
a2,
37+
a3,
38+
a4,
39+
a5,
40+
a6,
41+
a7,
42+
a8,
43+
a9
44+
].takeWhile((a) => a != _u).toList();
45+
return Function.apply(fn, args);
3646
} finally {
3747
_fakeAsync = null;
3848
}
3949
});
4050
},
41-
zoneSpecification: new ZoneSpecification(
42-
handleUncaughtError: (self, parent, zone, error, stackTrace)
43-
=> throw error
44-
));
51+
zoneSpecification: new ZoneSpecification(
52+
handleUncaughtError: (self, parent, zone, error, stackTrace) =>
53+
throw error));
4554
};
4655
}
4756

0 commit comments

Comments
 (0)