style(dart): Format with dartfmt v0.2.0

Format all pure Dart code with package:dart_style v0.2.0

Command:
```
find -type f -name "*.dart" | xargs dartformat -w
```
This commit is contained in:
Tim Blasi
2015-08-04 12:05:30 -07:00
parent 450d3630cc
commit f11f4e0b45
145 changed files with 1627 additions and 1013 deletions

View File

@ -18,8 +18,10 @@ import 'package:angular2/src/facade/lang.dart' show BaseException;
class Codegen {
/// Stores the generated class definitions.
final StringBuffer _buf = new StringBuffer();
/// Stores all generated initialization code.
final StringBuffer _initBuf = new StringBuffer();
/// The names of already generated classes.
final Set<String> _names = new Set<String>();
@ -78,12 +80,18 @@ class _CodegenState {
final CodegenNameUtil _names;
final bool _generateCheckNoChanges;
_CodegenState._(this._changeDetectorDefId, this._contextTypeName,
this._changeDetectorTypeName, String changeDetectionStrategy,
this._records, this._directiveRecords, this._logic, this._names,
_CodegenState._(
this._changeDetectorDefId,
this._contextTypeName,
this._changeDetectorTypeName,
String changeDetectionStrategy,
this._records,
this._directiveRecords,
this._logic,
this._names,
this._generateCheckNoChanges)
: _changeDetectionMode = ChangeDetectionUtil
.changeDetectionMode(changeDetectionStrategy);
: _changeDetectionMode =
ChangeDetectionUtil.changeDetectionMode(changeDetectionStrategy);
factory _CodegenState(String typeName, String changeDetectorTypeName,
ChangeDetectorDefinition def) {
@ -92,8 +100,15 @@ class _CodegenState {
var protoRecords = coalesce(recBuilder.records);
var names = new CodegenNameUtil(protoRecords, def.directiveRecords, _UTIL);
var logic = new CodegenLogicUtil(names, _UTIL);
return new _CodegenState._(def.id, typeName, changeDetectorTypeName,
def.strategy, protoRecords, def.directiveRecords, logic, names,
return new _CodegenState._(
def.id,
typeName,
changeDetectorTypeName,
def.strategy,
protoRecords,
def.directiveRecords,
logic,
names,
def.generateCheckNoChanges);
}

View File

@ -39,8 +39,8 @@ Future<String> processTemplates(AssetReader reader, AssetId entryPoint,
// Note: TemplateCloner(-1) never serializes Nodes into strings.
// we might want to change this to TemplateCloner(0) to force the serialization
// later when the transformer also stores the proto view template.
var extractor = new _TemplateExtractor(
new DomElementSchemaRegistry(), new TemplateCloner(-1), new XhrImpl(reader, entryPoint));
var extractor = new _TemplateExtractor(new DomElementSchemaRegistry(),
new TemplateCloner(-1), new XhrImpl(reader, entryPoint));
var registrations = new reg.Codegen();
var changeDetectorClasses = new change.Codegen();
@ -93,7 +93,8 @@ class _TemplateExtractor {
ElementSchemaRegistry _schemaRegistry;
TemplateCloner _templateCloner;
_TemplateExtractor(ElementSchemaRegistry schemaRegistry, TemplateCloner templateCloner, XHR xhr)
_TemplateExtractor(ElementSchemaRegistry schemaRegistry,
TemplateCloner templateCloner, XHR xhr)
: _factory = new CompileStepFactory(new ng.Parser(new ng.Lexer())) {
var urlResolver = new UrlResolver();
var styleUrlResolver = new StyleUrlResolver(urlResolver);
@ -120,10 +121,12 @@ class _TemplateExtractor {
var pipeline = new CompilePipeline(_factory.createSteps(viewDef));
var compileElements = pipeline.processElements(
DOM.createTemplate(templateAndStyles.template), ViewType.COMPONENT,
DOM.createTemplate(templateAndStyles.template),
ViewType.COMPONENT,
viewDef);
var protoViewDto =
compileElements[0].inheritedProtoView.build(_schemaRegistry, _templateCloner);
var protoViewDto = compileElements[0]
.inheritedProtoView
.build(_schemaRegistry, _templateCloner);
reflector.reflectionCapabilities = savedReflectionCapabilities;

View File

@ -39,8 +39,10 @@ _nullMethod(Object p, List a) => null;
class RecordingReflectionCapabilities extends NullReflectionCapabilities {
/// The names of all requested `getter`s.
final Set<String> getterNames = new Set<String>();
/// The names of all requested `setter`s.
final Set<String> setterNames = new Set<String>();
/// The names of all requested `method`s.
final Set<String> methodNames = new Set<String>();