Skip to content

Commit 2c99512

Browse files
author
Tim Blasi
committed
style(dart): Run dartfmt v0.1.8+2 on all pure Dart code
Update formatting for all pure Dart code in the repo.
1 parent 6fac901 commit 2c99512

File tree

63 files changed

+406
-273
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+406
-273
lines changed

modules/angular2/src/change_detection/pregen_proto_change_detector.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export 'package:angular2/src/change_detection/directive_record.dart'
1515
show DirectiveIndex, DirectiveRecord;
1616
export 'package:angular2/src/change_detection/interfaces.dart'
1717
show ChangeDetector, ChangeDetectorDefinition, ProtoChangeDetector;
18-
export 'package:angular2/src/change_detection/pipes/pipes.dart'
19-
show Pipes;
18+
export 'package:angular2/src/change_detection/pipes/pipes.dart' show Pipes;
2019
export 'package:angular2/src/change_detection/proto_record.dart'
2120
show ProtoRecord;
2221
export 'package:angular2/src/change_detection/change_detection_util.dart'
@@ -27,8 +26,7 @@ typedef ProtoChangeDetector PregenProtoChangeDetectorFactory(
2726
ChangeDetectorDefinition definition);
2827

2928
typedef ChangeDetector InstantiateMethod(dynamic dispatcher,
30-
List<ProtoRecord> protoRecords,
31-
List<DirectiveRecord> directiveRecords);
29+
List<ProtoRecord> protoRecords, List<DirectiveRecord> directiveRecords);
3230

3331
/// Implementation of [ProtoChangeDetector] for use by pre-generated change
3432
/// detectors in Angular 2 Dart.
@@ -52,19 +50,19 @@ class PregenProtoChangeDetector extends ProtoChangeDetector {
5250

5351
static bool isSupported() => true;
5452

55-
factory PregenProtoChangeDetector(InstantiateMethod instantiateMethod,
56-
ChangeDetectorDefinition def) {
53+
factory PregenProtoChangeDetector(
54+
InstantiateMethod instantiateMethod, ChangeDetectorDefinition def) {
5755
// TODO(kegluneq): Pre-generate these (#2067).
5856
var recordBuilder = new ProtoRecordBuilder();
5957
def.bindingRecords.forEach((b) {
6058
recordBuilder.add(b, def.variableNames);
6159
});
6260
var protoRecords = coalesce(recordBuilder.records);
63-
return new PregenProtoChangeDetector._(def.id, instantiateMethod,
64-
protoRecords, def.directiveRecords);
61+
return new PregenProtoChangeDetector._(
62+
def.id, instantiateMethod, protoRecords, def.directiveRecords);
6563
}
6664

6765
@override
68-
instantiate(dynamic dispatcher) => _instantiateMethod(
69-
dispatcher, _protoRecords, _directiveRecords);
66+
instantiate(dynamic dispatcher) =>
67+
_instantiateMethod(dispatcher, _protoRecords, _directiveRecords);
7068
}

modules/angular2/src/core/application.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ library angular2.application;
33
import 'dart:async';
44

55
import 'package:angular2/src/reflection/reflection.dart' show reflector;
6-
import 'package:angular2/src/reflection/reflection_capabilities.dart' show ReflectionCapabilities;
6+
import 'package:angular2/src/reflection/reflection_capabilities.dart'
7+
show ReflectionCapabilities;
78
import 'application_common.dart';
89

910
export 'application_common.dart' show ApplicationRef;

modules/angular2/src/core/application_static.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import 'application_common.dart';
66
/// Starts an application from a root component.
77
///
88
/// See [commonBootstrap] for detailed documentation.
9-
Future<ApplicationRef> bootstrapStatic(
10-
Type appComponentType,
9+
Future<ApplicationRef> bootstrapStatic(Type appComponentType,
1110
[List componentInjectableBindings]) {
1211
return commonBootstrap(appComponentType, componentInjectableBindings);
1312
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import './interface_query.dart';
1010
* In the future this class will implement an Observable interface.
1111
* For now it uses a plain list of observable callbacks.
1212
*/
13-
class QueryList<T> extends Object with IterableMixin<T> implements IQueryList<T> {
13+
class QueryList<T> extends Object with IterableMixin<T>
14+
implements IQueryList<T> {
1415
List<T> _results = [];
1516
List _callbacks = [];
1617
bool _dirty = false;

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ typedef void ErrorHandlingFn(error, stackTrace);
1111
* is cancelled.
1212
*/
1313
class WrappedTimer implements Timer {
14-
1514
Timer _timer;
1615
ZeroArgFunction _onCancelCb;
1716

@@ -124,7 +123,8 @@ class NgZone {
124123
*
125124
* This hook is useful for validating application state (e.g. in a test).
126125
*/
127-
void overrideOnEventDone(ZeroArgFunction onEventDoneFn, [bool waitForAsync = false]) {
126+
void overrideOnEventDone(ZeroArgFunction onEventDoneFn,
127+
[bool waitForAsync = false]) {
128128
_onEventDone = onEventDoneFn;
129129

130130
if (waitForAsync) {
@@ -264,7 +264,8 @@ class NgZone {
264264
}
265265
}
266266

267-
Timer _createTimer(Zone self, ZoneDelegate parent, Zone zone, Duration duration, fn()) {
267+
Timer _createTimer(
268+
Zone self, ZoneDelegate parent, Zone zone, Duration duration, fn()) {
268269
WrappedTimer wrappedTimer;
269270
var cb = () {
270271
fn();

modules/angular2/src/di/decorators.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,40 @@ export 'metadata.dart';
77
* {@link InjectMetadata}.
88
*/
99
class Inject extends InjectMetadata {
10-
const Inject(dynamic token): super(token);
10+
const Inject(dynamic token) : super(token);
1111
}
1212

1313
/**
1414
* {@link OptionalMetadata}.
1515
*/
1616
class Optional extends OptionalMetadata {
17-
const Optional(): super();
17+
const Optional() : super();
1818
}
1919

2020
/**
2121
* {@link InjectableMetadata}.
2222
*/
2323
class Injectable extends InjectableMetadata {
24-
const Injectable(): super();
24+
const Injectable() : super();
2525
}
2626

2727
/**
2828
* {@link SelfMetadata}.
2929
*/
3030
class Self extends SelfMetadata {
31-
const Self(): super();
31+
const Self() : super();
3232
}
3333

3434
/**
3535
* {@link AncestorMetadata}.
3636
*/
3737
class Ancestor extends AncestorMetadata {
38-
const Ancestor({bool self}): super(self:self);
38+
const Ancestor({bool self}) : super(self: self);
3939
}
4040

4141
/**
4242
* {@link UnboundedMetadata}.
4343
*/
4444
class Unbounded extends UnboundedMetadata {
45-
const Unbounded({bool self}): super(self:self);
46-
}
45+
const Unbounded({bool self}) : super(self: self);
46+
}

modules/angular2/src/directives/observable_list_diff.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ class ObservableListDiff extends IterableChanges {
4141
_updated = false;
4242
return super.transform(collection, args);
4343

44-
// An update has been registered since the last change detection check.
45-
// - We reset the flag.
46-
// - We diff the collection.
47-
} else if (_updated){
44+
// An update has been registered since the last change detection check.
45+
// - We reset the flag.
46+
// - We diff the collection.
47+
} else if (_updated) {
4848
_updated = false;
49-
return super.transform(collection, args);
49+
return super.transform(collection, args);
5050

51-
// No updates has been registered.
52-
// Returning this tells change detection that object has not change,
53-
// so it should NOT update the binding.
51+
// No updates has been registered.
52+
// Returning this tells change detection that object has not change,
53+
// so it should NOT update the binding.
5454
} else {
5555
return this;
5656
}

modules/angular2/src/dom/browser_adapter.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ class BrowserDomAdapter extends GenericBrowserDomAdapter {
392392
}
393393
}
394394

395-
396395
var baseElement = null;
397396
String getBaseElementHref() {
398397
if (baseElement == null) {

modules/angular2/src/dom/html_adapter.dart

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,25 @@ class Html5LibDomAdapter implements DomAdapter {
1717
return true;
1818
}
1919

20-
void setProperty(Element element, String name, Object value) => throw 'not implemented';
20+
void setProperty(Element element, String name, Object value) =>
21+
throw 'not implemented';
2122

2223
getProperty(Element element, String name) => throw 'not implemented';
2324

24-
invoke(Element element, String methodName, List args) => throw 'not implemented';
25+
invoke(Element element, String methodName, List args) =>
26+
throw 'not implemented';
2527

2628
logError(error) {
2729
stderr.writeln('${error}');
2830
}
2931

30-
log(error) { stdout.writeln('${error}'); }
31-
logGroup(error) { stdout.writeln('${error}'); }
32-
logGroupEnd() { }
33-
32+
log(error) {
33+
stdout.writeln('${error}');
34+
}
35+
logGroup(error) {
36+
stdout.writeln('${error}');
37+
}
38+
logGroupEnd() {}
3439

3540
@override
3641
final attrToPropMap = const {
@@ -245,8 +250,8 @@ class Html5LibDomAdapter implements DomAdapter {
245250
}
246251
getAttribute(element, String attribute) {
247252
// `attributes` keys can be {@link AttributeName}s.
248-
var key = element.attributes.keys.firstWhere(
249-
(key) => '$key' == attribute, orElse: () {});
253+
var key = element.attributes.keys.firstWhere((key) => '$key' == attribute,
254+
orElse: () {});
250255
return element.attributes[key];
251256
}
252257
setAttribute(element, String name, String value) {

modules/angular2/src/facade/async.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class PromiseWrapper {
2929
return promise.catchError(onError);
3030
}
3131

32-
static PromiseCompleter<dynamic> completer() => new PromiseCompleter(new Completer());
32+
static PromiseCompleter<dynamic> completer() =>
33+
new PromiseCompleter(new Completer());
3334
}
3435

3536
class TimerWrapper {

0 commit comments

Comments
 (0)