From 3bf8c18c56598e92b4c9055f9337a4da0ff37fb2 Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Fri, 10 Jul 2015 11:29:41 +0200 Subject: [PATCH] chore: run clang-format on code base. This fixes several minor indentation issues (instanceof precendence, type declaration specificity, template string length calculation). This should also fix some flip-flop situations with template strings. --- .../src/change_detection/change_detection.ts | 4 +- .../src/change_detection/parser/ast.ts | 6 +- .../change_detection/proto_change_detector.ts | 3 +- .../src/core/compiler/element_injector.ts | 19 ++--- .../src/core/compiler/proto_view_factory.ts | 24 +++--- modules/angular2/src/di/binding.ts | 19 ++--- modules/angular2/src/di/exceptions.ts | 3 +- modules/angular2/src/di/injector.ts | 4 +- modules/angular2/src/facade/collection.ts | 5 +- modules/angular2/src/forms/form_builder.ts | 6 +- modules/angular2/src/forms/model.ts | 8 +- .../angular2/src/render/dom/dom_renderer.ts | 4 +- .../src/render/dom/events/key_events.ts | 4 +- .../src/render/dom/view/proto_view_builder.ts | 12 +-- modules/angular2/src/test_lib/fake_async.ts | 15 ++-- modules/angular2/src/util/decorators.ts | 5 +- .../change_detector_config.ts | 79 ++++++++++--------- .../test/change_detection/coalesce_spec.ts | 7 +- .../test/change_detection/parser/unparser.ts | 3 +- .../test/core/compiler/compiler_spec.ts | 10 +-- .../angular2/test/render/dom/dom_testbed.ts | 4 +- .../benchpress/src/web_driver_extension.ts | 6 +- .../src/webdriver/chrome_driver_extension.ts | 4 +- .../webdriver/chrome_driver_extension_spec.ts | 4 +- .../webdriver/ios_driver_extension_spec.ts | 4 +- tools/broccoli/tree-differ.ts | 4 +- 26 files changed, 128 insertions(+), 138 deletions(-) diff --git a/modules/angular2/src/change_detection/change_detection.ts b/modules/angular2/src/change_detection/change_detection.ts index 098283594b..c7b936c3ba 100644 --- a/modules/angular2/src/change_detection/change_detection.ts +++ b/modules/angular2/src/change_detection/change_detection.ts @@ -122,8 +122,8 @@ export class PreGeneratedChangeDetection extends ChangeDetection { _dynamicChangeDetection: ChangeDetection; _protoChangeDetectorFactories: StringMap; - constructor(@Inject(PROTO_CHANGE_DETECTOR_KEY) @Optional() - protoChangeDetectorsForTest?: StringMap) { + constructor(@Inject(PROTO_CHANGE_DETECTOR_KEY) @Optional() protoChangeDetectorsForTest?: + StringMap) { super(); this._dynamicChangeDetection = new DynamicChangeDetection(); this._protoChangeDetectorFactories = isPresent(protoChangeDetectorsForTest) ? diff --git a/modules/angular2/src/change_detection/parser/ast.ts b/modules/angular2/src/change_detection/parser/ast.ts index 0f02849367..32ffe6062a 100644 --- a/modules/angular2/src/change_detection/parser/ast.ts +++ b/modules/angular2/src/change_detection/parser/ast.ts @@ -82,7 +82,7 @@ export class AccessMember extends AST { eval(context, locals: Locals): any { if (this.receiver instanceof ImplicitReceiver && isPresent(locals) && - locals.contains(this.name)) { + locals.contains(this.name)) { return locals.get(this.name); } else { var evaluatedReceiver = this.receiver.eval(context, locals); @@ -96,7 +96,7 @@ export class AccessMember extends AST { var evaluatedContext = this.receiver.eval(context, locals); if (this.receiver instanceof ImplicitReceiver && isPresent(locals) && - locals.contains(this.name)) { + locals.contains(this.name)) { throw new BaseException(`Cannot reassign a variable binding ${this.name}`); } else { return this.setter(evaluatedContext, value); @@ -267,7 +267,7 @@ export class MethodCall extends AST { eval(context, locals: Locals): any { var evaluatedArgs = evalList(context, locals, this.args); if (this.receiver instanceof ImplicitReceiver && isPresent(locals) && - locals.contains(this.name)) { + locals.contains(this.name)) { var fn = locals.get(this.name); return FunctionWrapper.apply(fn, evaluatedArgs); } else { diff --git a/modules/angular2/src/change_detection/proto_change_detector.ts b/modules/angular2/src/change_detection/proto_change_detector.ts index 4bb97bcce8..7dac88eebd 100644 --- a/modules/angular2/src/change_detection/proto_change_detector.ts +++ b/modules/angular2/src/change_detection/proto_change_detector.ts @@ -108,8 +108,7 @@ class _ConvertAstIntoProtoRecords implements AstVisitor { visitAccessMember(ast: AccessMember): number { var receiver = ast.receiver.visit(this); if (isPresent(this._variableNames) && ListWrapper.contains(this._variableNames, ast.name) && - ast.receiver instanceof - ImplicitReceiver) { + ast.receiver instanceof ImplicitReceiver) { return this._addRecord(RecordType.LOCAL, ast.name, ast.name, [], null, receiver); } else { return this._addRecord(RecordType.PROPERTY, ast.name, ast.getter, [], null, receiver); diff --git a/modules/angular2/src/core/compiler/element_injector.ts b/modules/angular2/src/core/compiler/element_injector.ts index ad9d24f482..5bd24ae844 100644 --- a/modules/angular2/src/core/compiler/element_injector.ts +++ b/modules/angular2/src/core/compiler/element_injector.ts @@ -241,12 +241,12 @@ export class DirectiveBinding extends ResolvedBinding { var resolvedHostInjectables = isPresent(ann.hostInjector) ? Injector.resolve(ann.hostInjector) : []; var resolvedViewInjectables = ann instanceof Component && isPresent(ann.viewInjector) ? - Injector.resolve(ann.viewInjector) : - []; + Injector.resolve(ann.viewInjector) : + []; var metadata = DirectiveMetadata.create({ id: stringify(rb.key.token), - type: ann instanceof - Component ? DirectiveMetadata.COMPONENT_TYPE : DirectiveMetadata.DIRECTIVE_TYPE, + type: ann instanceof Component ? DirectiveMetadata.COMPONENT_TYPE : + DirectiveMetadata.DIRECTIVE_TYPE, selector: ann.selector, compileChildren: ann.compileChildren, events: ann.events, @@ -260,8 +260,7 @@ export class DirectiveBinding extends ResolvedBinding { callOnInit: hasLifecycleHook(onInit, rb.key.token, ann), callOnAllChangesDone: hasLifecycleHook(onAllChangesDone, rb.key.token, ann), - changeDetection: ann instanceof - Component ? ann.changeDetection : null, + changeDetection: ann instanceof Component ? ann.changeDetection : null, exportAs: ann.exportAs }); @@ -452,10 +451,8 @@ export class ElementInjector extends TreeNode implements Depend // we couple ourselves to the injector strategy to avoid polymoprhic calls var injectorStrategy = this._injector.internalStrategy; this._strategy = injectorStrategy instanceof InjectorInlineStrategy ? - new ElementInjectorInlineStrategy( - injectorStrategy, this) : - new ElementInjectorDynamicStrategy( - injectorStrategy, this); + new ElementInjectorInlineStrategy(injectorStrategy, this) : + new ElementInjectorDynamicStrategy(injectorStrategy, this); this.hydrated = false; @@ -961,7 +958,7 @@ class ElementInjectorDynamicStrategy implements _ElementInjectorStrategy { for (var i = 0; i < p.bindings.length; i++) { if (p.bindings[i] instanceof DirectiveBinding && - (p.bindings[i]).callOnDestroy) { + (p.bindings[i]).callOnDestroy) { ist.objs[i].onDestroy(); } } diff --git a/modules/angular2/src/core/compiler/proto_view_factory.ts b/modules/angular2/src/core/compiler/proto_view_factory.ts index abcf140b8e..a6fa85e10f 100644 --- a/modules/angular2/src/core/compiler/proto_view_factory.ts +++ b/modules/angular2/src/core/compiler/proto_view_factory.ts @@ -39,9 +39,9 @@ class BindingRecordsCreator { return bindings; } - getDirectiveRecords( - elementBinders: List, - allDirectiveMetadatas: List): List { + getDirectiveRecords(elementBinders: List, + allDirectiveMetadatas: + List): List { var directiveRecords = []; for (var elementIndex = 0; elementIndex < elementBinders.length; ++elementIndex) { @@ -277,8 +277,8 @@ function _createVariableBindings(renderProtoView): Map { return variableBindings; } -function _collectNestedProtoViewsVariableNames( - nestedPvsWithIndex: List): List> { +function _collectNestedProtoViewsVariableNames(nestedPvsWithIndex: List): + List> { var nestedPvVariableNames = ListWrapper.createFixedSize(nestedPvsWithIndex.length); ListWrapper.forEach(nestedPvsWithIndex, (pvWithIndex) => { var parentVariableNames = @@ -301,8 +301,8 @@ function _createVariableNames(parentVariableNames: List, renderProtoView return res; } -export function createVariableLocations( - elementBinders: List): Map { +export function createVariableLocations(elementBinders: List): + Map { var variableLocations = new Map(); for (var i = 0; i < elementBinders.length; i++) { var binder = elementBinders[i]; @@ -374,8 +374,8 @@ function _createProtoElementInjector(binderIndex, parentPeiWithDistance, renderE } function _createElementBinder(protoView: AppProtoView, boundElementIndex, renderElementBinder, - protoElementInjector, componentDirectiveBinding, - directiveBindings): ElementBinder { + protoElementInjector, componentDirectiveBinding, directiveBindings): + ElementBinder { var parent = null; if (renderElementBinder.parentIndex !== -1) { parent = protoView.elementBinders[renderElementBinder.parentIndex]; @@ -393,9 +393,9 @@ function _createElementBinder(protoView: AppProtoView, boundElementIndex, render return elBinder; } -export function createDirectiveVariableBindings( - renderElementBinder: renderApi.ElementBinder, - directiveBindings: List): Map { +export function createDirectiveVariableBindings(renderElementBinder: renderApi.ElementBinder, + directiveBindings: List): + Map { var directiveVariableBindings = new Map(); MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => { var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs); diff --git a/modules/angular2/src/di/binding.ts b/modules/angular2/src/di/binding.ts index a19eb44d59..5751e8d8d5 100644 --- a/modules/angular2/src/di/binding.ts +++ b/modules/angular2/src/di/binding.ts @@ -177,13 +177,10 @@ export class Binding { */ dependencies: List; - constructor(token, {toClass, toValue, toAlias, toFactory, deps}: { - toClass?: Type, - toValue?: any, - toAlias?: any, - toFactory?: Function, - deps?: List - }) { + constructor( + token, + {toClass, toValue, toAlias, toFactory, deps}: + {toClass?: Type, toValue?: any, toAlias?: any, toFactory?: Function, deps?: List}) { this.token = token; this.toClass = toClass; this.toValue = toValue; @@ -374,8 +371,8 @@ export class BindingBuilder { } } -function _constructDependencies(factoryFunction: Function, - dependencies: List): List { +function _constructDependencies(factoryFunction: Function, dependencies: List): + List { if (isBlank(dependencies)) { return _dependenciesFor(factoryFunction); } else { @@ -393,8 +390,8 @@ function _dependenciesFor(typeOrFunc): List { return ListWrapper.map(params, (p: List) => _extractToken(typeOrFunc, p, params)); } -function _extractToken(typeOrFunc, annotations /*List | any*/, - params: List>): Dependency { +function _extractToken(typeOrFunc, annotations /*List | any*/, params: List>): + Dependency { var depProps = []; var token = null; var optional = false; diff --git a/modules/angular2/src/di/exceptions.ts b/modules/angular2/src/di/exceptions.ts index aae9c2a104..07bbd91f90 100644 --- a/modules/angular2/src/di/exceptions.ts +++ b/modules/angular2/src/di/exceptions.ts @@ -135,8 +135,7 @@ export class InstantiationError extends AbstractBindingError { super(key, function(keys: List) { var first = stringify(ListWrapper.first(keys).token); return `Error during instantiation of ${first}!${constructResolvingPath(keys)}.` + - ` ORIGINAL ERROR: ${originalException}` + - `\n\n ORIGINAL STACK: ${originalStack}`; + ` ORIGINAL ERROR: ${originalException}` + `\n\n ORIGINAL STACK: ${originalStack}`; }, originalException, originalStack); this.causeKey = key; diff --git a/modules/angular2/src/di/injector.ts b/modules/angular2/src/di/injector.ts index 6a9994a56e..64ccf7f5de 100644 --- a/modules/angular2/src/di/injector.ts +++ b/modules/angular2/src/di/injector.ts @@ -786,8 +786,8 @@ function _resolveBindings(bindings: List>): List): List { +function _createListOfBindings(flattenedBindings: Map): + List { return MapWrapper.values(flattenedBindings); } diff --git a/modules/angular2/src/facade/collection.ts b/modules/angular2/src/facade/collection.ts index 891f1886ec..56bd0f1ead 100644 --- a/modules/angular2/src/facade/collection.ts +++ b/modules/angular2/src/facade/collection.ts @@ -10,9 +10,8 @@ export var StringMap = global.Object; var createMapFromPairs: {(pairs: List): Map} = (function() { try { if (new Map([1, 2]).size === 2) { - return function createMapFromPairs(pairs: List): Map { - return new Map(pairs); - }; + return function createMapFromPairs(pairs: List): + Map { return new Map(pairs); }; } } catch (e) { } diff --git a/modules/angular2/src/forms/form_builder.ts b/modules/angular2/src/forms/form_builder.ts index 3ca22d5fa8..3448d44ecb 100644 --- a/modules/angular2/src/forms/form_builder.ts +++ b/modules/angular2/src/forms/form_builder.ts @@ -107,9 +107,9 @@ export class FormBuilder { } _createControl(controlConfig: any): modelModule.AbstractControl { - if (controlConfig instanceof modelModule.Control || controlConfig instanceof - modelModule.ControlGroup || controlConfig instanceof - modelModule.ControlArray) { + if (controlConfig instanceof modelModule.Control || + controlConfig instanceof modelModule.ControlGroup || + controlConfig instanceof modelModule.ControlArray) { return controlConfig; } else if (isArray(controlConfig)) { diff --git a/modules/angular2/src/forms/model.ts b/modules/angular2/src/forms/model.ts index fd931bb6a8..eaca30f389 100644 --- a/modules/angular2/src/forms/model.ts +++ b/modules/angular2/src/forms/model.ts @@ -98,8 +98,8 @@ export class AbstractControl { } } - updateValueAndValidity({onlySelf, emitEvent}: {onlySelf?: boolean, - emitEvent?: boolean} = {}): void { + updateValueAndValidity({onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): + void { onlySelf = isPresent(onlySelf) ? onlySelf : false; emitEvent = isPresent(emitEvent) ? emitEvent : true; @@ -151,8 +151,8 @@ export class Control extends AbstractControl { this._valueChanges = new EventEmitter(); } - updateValue(value: any, - {onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { + updateValue(value: any, {onlySelf, emitEvent}: {onlySelf?: boolean, emitEvent?: boolean} = {}): + void { this._value = value; if (isPresent(this._onChange)) this._onChange(this._value); this.updateValueAndValidity({onlySelf: onlySelf, emitEvent: emitEvent}); diff --git a/modules/angular2/src/render/dom/dom_renderer.ts b/modules/angular2/src/render/dom/dom_renderer.ts index dd93bad85f..41962e3529 100644 --- a/modules/angular2/src/render/dom/dom_renderer.ts +++ b/modules/angular2/src/render/dom/dom_renderer.ts @@ -188,8 +188,8 @@ export class DomRenderer extends Renderer { view.setElementProperty(location.boundElementIndex, propertyName, propertyValue); } - setElementAttribute(location: RenderElementRef, attributeName: string, - attributeValue: string): void { + setElementAttribute(location: RenderElementRef, attributeName: string, attributeValue: string): + void { var view = resolveInternalDomView(location.renderView); view.setElementAttribute(location.boundElementIndex, attributeName, attributeValue); } diff --git a/modules/angular2/src/render/dom/events/key_events.ts b/modules/angular2/src/render/dom/events/key_events.ts index e1628e7f26..c4134bee86 100644 --- a/modules/angular2/src/render/dom/events/key_events.ts +++ b/modules/angular2/src/render/dom/events/key_events.ts @@ -89,8 +89,8 @@ export class KeyEventsPlugin extends EventManagerPlugin { return fullKey; } - static eventCallback(element, shouldSupportBubble, fullKey, handler, - zone): (event: Event) => void { + static eventCallback(element, shouldSupportBubble, fullKey, handler, zone): + (event: Event) => void { return (event) => { var correctElement = shouldSupportBubble || event.target === element; if (correctElement && StringWrapper.equals(KeyEventsPlugin.getEventFullKey(event), fullKey)) { diff --git a/modules/angular2/src/render/dom/view/proto_view_builder.ts b/modules/angular2/src/render/dom/view/proto_view_builder.ts index 04cc4d4912..d8dbcda48f 100644 --- a/modules/angular2/src/render/dom/view/proto_view_builder.ts +++ b/modules/angular2/src/render/dom/view/proto_view_builder.ts @@ -343,10 +343,10 @@ const ATTRIBUTE_PREFIX = 'attr'; const CLASS_PREFIX = 'class'; const STYLE_PREFIX = 'style'; -function buildElementPropertyBindings( - protoElement: /*element*/ any, isNgComponent: boolean, - bindingsInTemplate: Map, - directiveTempaltePropertyNames: Set): List { +function buildElementPropertyBindings(protoElement: /*element*/ any, isNgComponent: boolean, + bindingsInTemplate: Map, + directiveTempaltePropertyNames: Set): + List { var propertyBindings = []; MapWrapper.forEach(bindingsInTemplate, (ast, propertyNameInTemplate) => { var propertyBinding = createElementPropertyBinding(ast, propertyNameInTemplate); @@ -376,8 +376,8 @@ function isValidElementPropertyBinding(protoElement: /*element*/ any, isNgCompon return true; } -function createElementPropertyBinding(ast: ASTWithSource, - propertyNameInTemplate: string): api.ElementPropertyBinding { +function createElementPropertyBinding(ast: ASTWithSource, propertyNameInTemplate: string): + api.ElementPropertyBinding { var parts = StringWrapper.split(propertyNameInTemplate, PROPERTY_PARTS_SEPARATOR); if (parts.length === 1) { var propName = parts[0]; diff --git a/modules/angular2/src/test_lib/fake_async.ts b/modules/angular2/src/test_lib/fake_async.ts index 8f24389f83..f6c157601e 100644 --- a/modules/angular2/src/test_lib/fake_async.ts +++ b/modules/angular2/src/test_lib/fake_async.ts @@ -38,7 +38,7 @@ export function fakeAsync(fn: Function): Function { _inFakeAsyncZone: true }); - return function(... args) { + return function(...args) { // TODO(tbosch): This class should already be part of the jasmine typings but it is not... _scheduler = new (jasmine).DelayedFunctionScheduler(); ListWrapper.clear(_microtasks); @@ -46,7 +46,7 @@ export function fakeAsync(fn: Function): Function { ListWrapper.clear(_pendingTimers); let res = fakeAsyncZone.run(() => { - let res = fn(... args); + let res = fn(...args); flushMicrotasks(); return res; }); @@ -92,7 +92,7 @@ export function flushMicrotasks(): void { } } -function _setTimeout(fn: Function, delay: number, ... args): number { +function _setTimeout(fn: Function, delay: number, ...args): number { var cb = _fnAndFlush(fn); var id = _scheduler.scheduleFunction(cb, delay, args); _pendingTimers.push(id); @@ -105,7 +105,7 @@ function _clearTimeout(id: number) { return _scheduler.removeFunctionWithId(id); } -function _setInterval(fn: Function, interval: number, ... args) { +function _setInterval(fn: Function, interval: number, ...args) { var cb = _fnAndFlush(fn); var id = _scheduler.scheduleFunction(cb, interval, args, true); _pendingPeriodicTimers.push(id); @@ -118,9 +118,10 @@ function _clearInterval(id: number) { } function _fnAndFlush(fn: Function): Function { - return (... args) => { fn.apply(global, args); - flushMicrotasks(); -} + return (...args) => { + fn.apply(global, args); + flushMicrotasks(); + } } function _scheduleMicrotask(microtask: Function): void { diff --git a/modules/angular2/src/util/decorators.ts b/modules/angular2/src/util/decorators.ts index 89e763a8ff..d24ade34ce 100644 --- a/modules/angular2/src/util/decorators.ts +++ b/modules/angular2/src/util/decorators.ts @@ -242,9 +242,8 @@ export function makeDecorator(annotationCls, chainFn: (fn: Function) => void = n if (this instanceof annotationCls) { return annotationInstance; } else { - var chainAnnotation = isFunction(this) && this.annotations instanceof Array ? - this.annotations : - []; + var chainAnnotation = + isFunction(this) && this.annotations instanceof Array ? this.annotations : []; chainAnnotation.push(annotationInstance); var TypeDecorator: TypeDecorator = function TypeDecorator(cls) { var annotations = Reflect.getMetadata('annotations', cls); diff --git a/modules/angular2/test/change_detection/change_detector_config.ts b/modules/angular2/test/change_detection/change_detector_config.ts index ac223956b9..394ab340e3 100644 --- a/modules/angular2/test/change_detection/change_detector_config.ts +++ b/modules/angular2/test/change_detection/change_detector_config.ts @@ -213,45 +213,48 @@ class _DirectiveUpdating { * Map from test id to _DirectiveUpdating. * Definitions in this map define definitions which allow testing directive updating. */ - static availableDefinitions: StringMap = { - 'directNoDispatcher': new _DirectiveUpdating( - [_DirectiveUpdating.updateA('42', _DirectiveUpdating.basicRecords[0])], - [_DirectiveUpdating.basicRecords[0]]), - 'groupChanges': new _DirectiveUpdating( - [ - _DirectiveUpdating.updateA('1', _DirectiveUpdating.basicRecords[0]), - _DirectiveUpdating.updateB('2', _DirectiveUpdating.basicRecords[0]), - BindingRecord.createDirectiveOnChange(_DirectiveUpdating.basicRecords[0]), - _DirectiveUpdating.updateA('3', _DirectiveUpdating.basicRecords[1]), - BindingRecord.createDirectiveOnChange(_DirectiveUpdating.basicRecords[1]) - ], - [_DirectiveUpdating.basicRecords[0], _DirectiveUpdating.basicRecords[1]]), - 'directiveOnCheck': new _DirectiveUpdating( - [BindingRecord.createDirectiveOnCheck(_DirectiveUpdating.basicRecords[0])], - [_DirectiveUpdating.basicRecords[0]]), - 'directiveOnInit': new _DirectiveUpdating( - [BindingRecord.createDirectiveOnInit(_DirectiveUpdating.basicRecords[0])], - [_DirectiveUpdating.basicRecords[0]]), - 'emptyWithDirectiveRecords': new _DirectiveUpdating( - [], [_DirectiveUpdating.basicRecords[0], _DirectiveUpdating.basicRecords[1]]), - 'noCallbacks': new _DirectiveUpdating( - [_DirectiveUpdating.updateA('1', _DirectiveUpdating.recordNoCallbacks)], - [_DirectiveUpdating.recordNoCallbacks]), - 'readingDirectives': - new _DirectiveUpdating( - [ - BindingRecord.createForHostProperty( - new DirectiveIndex(0, 0), _getParser().parseBinding('a', 'location'), PROP_NAME) - ], + static availableDefinitions: + StringMap = { + 'directNoDispatcher': new _DirectiveUpdating( + [_DirectiveUpdating.updateA('42', _DirectiveUpdating.basicRecords[0])], [_DirectiveUpdating.basicRecords[0]]), - 'interpolation': - new _DirectiveUpdating( - [ - BindingRecord.createForElementProperty( - _getParser().parseInterpolation('B{{a}}A', 'location'), 0, PROP_NAME) - ], - []) - }; + 'groupChanges': + new _DirectiveUpdating( + [ + _DirectiveUpdating.updateA('1', _DirectiveUpdating.basicRecords[0]), + _DirectiveUpdating.updateB('2', _DirectiveUpdating.basicRecords[0]), + BindingRecord.createDirectiveOnChange(_DirectiveUpdating.basicRecords[0]), + _DirectiveUpdating.updateA('3', _DirectiveUpdating.basicRecords[1]), + BindingRecord.createDirectiveOnChange(_DirectiveUpdating.basicRecords[1]) + ], + [_DirectiveUpdating.basicRecords[0], _DirectiveUpdating.basicRecords[1]]), + 'directiveOnCheck': new _DirectiveUpdating( + [BindingRecord.createDirectiveOnCheck(_DirectiveUpdating.basicRecords[0])], + [_DirectiveUpdating.basicRecords[0]]), + 'directiveOnInit': new _DirectiveUpdating( + [BindingRecord.createDirectiveOnInit(_DirectiveUpdating.basicRecords[0])], + [_DirectiveUpdating.basicRecords[0]]), + 'emptyWithDirectiveRecords': new _DirectiveUpdating( + [], [_DirectiveUpdating.basicRecords[0], _DirectiveUpdating.basicRecords[1]]), + 'noCallbacks': new _DirectiveUpdating( + [_DirectiveUpdating.updateA('1', _DirectiveUpdating.recordNoCallbacks)], + [_DirectiveUpdating.recordNoCallbacks]), + 'readingDirectives': + new _DirectiveUpdating( + [ + BindingRecord.createForHostProperty(new DirectiveIndex(0, 0), + _getParser().parseBinding('a', 'location'), + PROP_NAME) + ], + [_DirectiveUpdating.basicRecords[0]]), + 'interpolation': + new _DirectiveUpdating( + [ + BindingRecord.createForElementProperty( + _getParser().parseInterpolation('B{{a}}A', 'location'), 0, PROP_NAME) + ], + []) + }; } /** diff --git a/modules/angular2/test/change_detection/coalesce_spec.ts b/modules/angular2/test/change_detection/coalesce_spec.ts index 96debe68a1..6d3eb5c8a9 100644 --- a/modules/angular2/test/change_detection/coalesce_spec.ts +++ b/modules/angular2/test/change_detection/coalesce_spec.ts @@ -6,10 +6,9 @@ import {RecordType, ProtoRecord} from 'angular2/src/change_detection/proto_recor import {DirectiveIndex} from 'angular2/src/change_detection/directive_record'; export function main() { - function r( - funcOrValue, args, contextIndex, selfIndex, - {lastInBinding, mode, name, - directiveIndex}: {lastInBinding?: any, mode?: any, name?: any, directiveIndex?: any} = {}) { + function r(funcOrValue, args, contextIndex, selfIndex, + {lastInBinding, mode, name, directiveIndex}: + {lastInBinding?: any, mode?: any, name?: any, directiveIndex?: any} = {}) { if (isBlank(lastInBinding)) lastInBinding = false; if (isBlank(mode)) mode = RecordType.PROPERTY; if (isBlank(name)) name = "name"; diff --git a/modules/angular2/test/change_detection/parser/unparser.ts b/modules/angular2/test/change_detection/parser/unparser.ts index 6090d005f8..172ebd63c2 100644 --- a/modules/angular2/test/change_detection/parser/unparser.ts +++ b/modules/angular2/test/change_detection/parser/unparser.ts @@ -158,8 +158,7 @@ export class Unparser implements AstVisitor { visitMethodCall(ast: MethodCall) { this._visit(ast.receiver); - this._expression += ast.receiver instanceof ImplicitReceiver ? `${ast.name}(` : - `.${ast.name}(`; + this._expression += ast.receiver instanceof ImplicitReceiver ? `${ast.name}(` : `.${ast.name}(`; var isFirst = true; ast.args.forEach(arg => { if (!isFirst) this._expression += ', '; diff --git a/modules/angular2/test/core/compiler/compiler_spec.ts b/modules/angular2/test/core/compiler/compiler_spec.ts index 629a7688b3..343601f0c2 100644 --- a/modules/angular2/test/core/compiler/compiler_spec.ts +++ b/modules/angular2/test/core/compiler/compiler_spec.ts @@ -58,9 +58,9 @@ export function main() { rootProtoView = createRootProtoView(directiveResolver, MainComponent); }); - function createCompiler( - renderCompileResults: List>, - protoViewFactoryResults: List>) { + function createCompiler(renderCompileResults: + List>, + protoViewFactoryResults: List>) { var urlResolver = new UrlResolver(); renderCompileRequests = []; renderCompiler.spy('compile').andCallFake((view) => { @@ -510,8 +510,8 @@ function createViewportElementBinder(nestedProtoView): ElementBinder { return elBinder; } -function createRenderProtoView(elementBinders = null, - type: renderApi.ViewType = null): renderApi.ProtoViewDto { +function createRenderProtoView(elementBinders = null, type: renderApi.ViewType = null): + renderApi.ProtoViewDto { if (isBlank(type)) { type = renderApi.ViewType.COMPONENT; } diff --git a/modules/angular2/test/render/dom/dom_testbed.ts b/modules/angular2/test/render/dom/dom_testbed.ts index e5ba5c1a9a..5c70ad5d84 100644 --- a/modules/angular2/test/render/dom/dom_testbed.ts +++ b/modules/angular2/test/render/dom/dom_testbed.ts @@ -67,8 +67,8 @@ export class DomTestbed { DOM.appendChild(DOM.querySelector(document, 'body'), this.rootEl); } - compileAll(directivesOrViewDefinitions: List): Promise> { + compileAll(directivesOrViewDefinitions: + List): Promise> { return PromiseWrapper.all(ListWrapper.map(directivesOrViewDefinitions, (entry) => { if (entry instanceof DirectiveMetadata) { return this.compiler.compileHost(entry); diff --git a/modules/benchpress/src/web_driver_extension.ts b/modules/benchpress/src/web_driver_extension.ts index 4bba52d893..a9295d65c3 100644 --- a/modules/benchpress/src/web_driver_extension.ts +++ b/modules/benchpress/src/web_driver_extension.ts @@ -69,10 +69,8 @@ export class PerfLogFeatures { gc: boolean; frameCapture: boolean; - constructor({render = false, gc = false, - frameCapture = false}: {render?: boolean, - gc?: boolean, - frameCapture?: boolean} = {}) { + constructor({render = false, gc = false, frameCapture = false}: + {render?: boolean, gc?: boolean, frameCapture?: boolean} = {}) { this.render = render; this.gc = gc; this.frameCapture = frameCapture; diff --git a/modules/benchpress/src/webdriver/chrome_driver_extension.ts b/modules/benchpress/src/webdriver/chrome_driver_extension.ts index 6fcfe9328e..6482e53a3c 100644 --- a/modules/benchpress/src/webdriver/chrome_driver_extension.ts +++ b/modules/benchpress/src/webdriver/chrome_driver_extension.ts @@ -141,8 +141,8 @@ export class ChromeDriverExtension extends WebDriverExtension { } } -function normalizeEvent(chromeEvent: StringMap, - data: StringMap): StringMap { +function normalizeEvent(chromeEvent: StringMap, data: StringMap): + StringMap { var ph = chromeEvent['ph']; if (StringWrapper.equals(ph, 'S')) { ph = 'b'; diff --git a/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts b/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts index e9052abc68..a51141abd4 100644 --- a/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts +++ b/modules/benchpress/test/webdriver/chrome_driver_extension_spec.ts @@ -81,8 +81,8 @@ export function main() { createExtension() .timeEnd('name1', 'name2') .then((_) => { - expect(log).toEqual( - [['executeScript', `console.timeEnd('name1');console.time('name2');`]]); + expect(log) + .toEqual([['executeScript', `console.timeEnd('name1');console.time('name2');`]]); async.done(); }); })); diff --git a/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts b/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts index 555ddff4a6..e854f9ebe6 100644 --- a/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts +++ b/modules/benchpress/test/webdriver/ios_driver_extension_spec.ts @@ -71,8 +71,8 @@ export function main() { createExtension() .timeEnd('name1', 'name2') .then((_) => { - expect(log).toEqual( - [['executeScript', `console.timeEnd('name1');console.time('name2');`]]); + expect(log) + .toEqual([['executeScript', `console.timeEnd('name1');console.time('name2');`]]); async.done(); }); })); diff --git a/tools/broccoli/tree-differ.ts b/tools/broccoli/tree-differ.ts index 29e4dad0ef..8e47162b9b 100644 --- a/tools/broccoli/tree-differ.ts +++ b/tools/broccoli/tree-differ.ts @@ -155,8 +155,8 @@ class DirtyCheckingDiffResult extends DiffResult { .concat(this.changedPaths.map(p => `* ${p}`)) .concat(this.removedPaths.map(p => `- ${p}`)); console.log(`Tree diff: ${this}` + ((verbose && prefixedPaths.length) ? - ` [\n ${prefixedPaths.join('\n ')}\n]` : - '')); + ` [\n ${prefixedPaths.join('\n ')}\n]` : + '')); } }