Skip to content

Commit 2c25055

Browse files
committed
chore: reformat the code base using the clang-format 1.0.15.
1 parent 96f629d commit 2c25055

File tree

10 files changed

+117
-139
lines changed

10 files changed

+117
-139
lines changed

modules/angular2/src/core/annotations_impl/annotations.ts

Lines changed: 31 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -752,29 +752,20 @@ export class Directive extends Injectable {
752752
hostInjector: List<any>;
753753

754754
constructor({
755-
selector,
756-
properties,
757-
events,
758-
hostListeners,
759-
hostProperties,
760-
hostAttributes,
761-
hostActions,
762-
lifecycle,
763-
hostInjector,
764-
compileChildren = true,
765-
}:{
766-
selector?:string,
767-
properties?:any,
768-
events?:List<string>,
769-
hostListeners?: StringMap<string, string>,
770-
hostProperties?: StringMap<string, string>,
771-
hostAttributes?: StringMap<string, string>,
772-
hostActions?: StringMap<string, string>,
773-
lifecycle?:List<LifecycleEvent>,
774-
hostInjector?:List<any>,
775-
compileChildren?:boolean
776-
}={})
777-
{
755+
selector, properties, events, hostListeners, hostProperties, hostAttributes,
756+
hostActions, lifecycle, hostInjector, compileChildren = true,
757+
}: {
758+
selector?: string,
759+
properties?: any,
760+
events?: List<string>,
761+
hostListeners?: StringMap<string, string>,
762+
hostProperties?: StringMap<string, string>,
763+
hostAttributes?: StringMap<string, string>,
764+
hostActions?: StringMap<string, string>,
765+
lifecycle?: List<LifecycleEvent>,
766+
hostInjector?: List<any>,
767+
compileChildren?: boolean
768+
} = {}) {
778769
super();
779770
this.selector = selector;
780771
this.properties = properties;
@@ -995,36 +986,23 @@ export class Component extends Directive {
995986
*/
996987
viewInjector: List<any>;
997988

998-
constructor({
999-
selector,
1000-
properties,
1001-
events,
1002-
hostListeners,
1003-
hostProperties,
1004-
hostAttributes,
1005-
hostActions,
1006-
appInjector,
1007-
lifecycle,
1008-
hostInjector,
1009-
viewInjector,
1010-
changeDetection = DEFAULT,
1011-
compileChildren = true
1012-
}:{
1013-
selector?:string,
1014-
properties?:Object,
1015-
events?:List<string>,
1016-
hostListeners?:Map<string,string>,
1017-
hostProperties?:any,
1018-
hostAttributes?:any,
1019-
hostActions?:any,
1020-
appInjector?:List<any>,
1021-
lifecycle?:List<LifecycleEvent>,
1022-
hostInjector?:List<any>,
1023-
viewInjector?:List<any>,
1024-
changeDetection?:string,
1025-
compileChildren?:boolean
1026-
}={})
1027-
{
989+
constructor({selector, properties, events, hostListeners, hostProperties, hostAttributes,
990+
hostActions, appInjector, lifecycle, hostInjector, viewInjector,
991+
changeDetection = DEFAULT, compileChildren = true}: {
992+
selector?: string,
993+
properties?: Object,
994+
events?: List<string>,
995+
hostListeners?: Map<string, string>,
996+
hostProperties?: any,
997+
hostAttributes?: any,
998+
hostActions?: any,
999+
appInjector?: List<any>,
1000+
lifecycle?: List<LifecycleEvent>,
1001+
hostInjector?: List<any>,
1002+
viewInjector?: List<any>,
1003+
changeDetection?: string,
1004+
compileChildren?: boolean
1005+
} = {}) {
10281006
super({
10291007
selector: selector,
10301008
properties: properties,

modules/angular2/src/core/annotations_impl/view.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,12 @@ export class View {
8484
*/
8585
renderer: string;
8686

87-
constructor({
88-
templateUrl,
89-
template,
90-
directives,
91-
renderer
92-
}: {
93-
templateUrl?: string,
94-
template?: string,
95-
directives?: List<Type | any | List<any>>,
96-
renderer?: string
97-
} = {})
98-
{
87+
constructor({templateUrl, template, directives, renderer}: {
88+
templateUrl?: string,
89+
template?: string,
90+
directives?: List<Type | any | List<any>>,
91+
renderer?: string
92+
} = {}) {
9993
this.templateUrl = templateUrl;
10094
this.template = template;
10195
this.directives = directives;

modules/angular2/src/di/binding.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,13 @@ export class Binding {
196196
dependencies: List<any>;
197197

198198
constructor(token, {toClass, toValue, toAlias, toFactory, toAsyncFactory, deps}: {
199-
toClass ?: Type, toValue ?: any, toAlias ?: any, toFactory ?: Function,
200-
toAsyncFactory ?: Function, deps ?: List<any>}) {
199+
toClass?: Type,
200+
toValue?: any,
201+
toAlias?: any,
202+
toFactory?: Function,
203+
toAsyncFactory?: Function,
204+
deps?: List<any>
205+
}) {
201206
this.token = token;
202207
this.toClass = toClass;
203208
this.toValue = toValue;

modules/angular2/src/facade/lang.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var _global: BrowserNodeGlobal = <any>(typeof window === 'undefined' ? global :
22
export {_global as global};
33

44
export var Type = Function;
5-
export type Type = new (... args: any[]) => any;
5+
export type Type = new (...args: any[]) => any;
66

77
export class BaseException extends Error {
88
message;
@@ -116,7 +116,7 @@ export class StringWrapper {
116116
}
117117

118118
static replaceAllMapped(s: string, from: RegExp, cb: Function): string {
119-
return s.replace(from, function(... matches) {
119+
return s.replace(from, function(...matches) {
120120
// Remove offset & string from the result array
121121
matches.splice(-2, 2);
122122
// The callback receives match, p1, ..., pn

modules/angular2/src/render/api.ts

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,19 @@ export class ElementBinder {
4444
textBindings: List<ASTWithSource>;
4545
readAttributes: Map<string, string>;
4646

47-
constructor({
48-
index, parentIndex, distanceToParent,
49-
directives, nestedProtoView,
50-
propertyBindings, variableBindings,
51-
eventBindings, textBindings,
52-
readAttributes
53-
}:{index?:number, parentIndex?:number, distanceToParent?:number,
54-
directives?:List<DirectiveBinder>, nestedProtoView?:ProtoViewDto,
55-
propertyBindings?:Map<string, ASTWithSource>, variableBindings?:Map<string, ASTWithSource>,
56-
eventBindings?:List<EventBinding>, textBindings?:List<ASTWithSource>,
57-
readAttributes?:Map<string, string>}={}) {
47+
constructor({index, parentIndex, distanceToParent, directives, nestedProtoView, propertyBindings,
48+
variableBindings, eventBindings, textBindings, readAttributes}: {
49+
index?: number,
50+
parentIndex?: number,
51+
distanceToParent?: number,
52+
directives?: List<DirectiveBinder>,
53+
nestedProtoView?: ProtoViewDto,
54+
propertyBindings?: Map<string, ASTWithSource>,
55+
variableBindings?: Map<string, ASTWithSource>,
56+
eventBindings?: List<EventBinding>,
57+
textBindings?: List<ASTWithSource>,
58+
readAttributes?: Map<string, string>
59+
} = {}) {
5860
this.index = index;
5961
this.parentIndex = parentIndex;
6062
this.distanceToParent = distanceToParent;
@@ -77,11 +79,11 @@ export class DirectiveBinder {
7779
// with a local name
7880
eventBindings: List<EventBinding>;
7981
hostPropertyBindings: Map<string, ASTWithSource>;
80-
constructor({
81-
directiveIndex, propertyBindings, eventBindings, hostPropertyBindings
82-
}:{
83-
directiveIndex?:number, propertyBindings?:Map<string, ASTWithSource>,
84-
eventBindings?:List<EventBinding>, hostPropertyBindings?:Map<string, ASTWithSource>
82+
constructor({directiveIndex, propertyBindings, eventBindings, hostPropertyBindings}: {
83+
directiveIndex?: number,
84+
propertyBindings?: Map<string, ASTWithSource>,
85+
eventBindings?: List<EventBinding>,
86+
hostPropertyBindings?: Map<string, ASTWithSource>
8587
}) {
8688
this.directiveIndex = directiveIndex;
8789
this.propertyBindings = propertyBindings;
@@ -107,12 +109,12 @@ export class ProtoViewDto {
107109
variableBindings: Map<string, string>;
108110
type: number;
109111

110-
constructor({
111-
render, elementBinders, variableBindings, type
112-
}:{
113-
render?:RenderProtoViewRef, elementBinders?:List<ElementBinder>,
114-
variableBindings?:Map<string, string>, type?:number
115-
}) {
112+
constructor({render, elementBinders, variableBindings, type}: {
113+
render?: RenderProtoViewRef,
114+
elementBinders?: List<ElementBinder>,
115+
variableBindings?: Map<string, string>,
116+
type?: number
117+
}) {
116118
this.render = render;
117119
this.elementBinders = elementBinders;
118120
this.variableBindings = variableBindings;
@@ -138,17 +140,25 @@ export class DirectiveMetadata {
138140
callOnChange: boolean;
139141
callOnAllChangesDone: boolean;
140142
changeDetection: string;
141-
constructor({
142-
id, selector, compileChildren, events, hostListeners, hostProperties,
143-
hostAttributes, hostActions, properties, readAttributes, type,
144-
callOnDestroy, callOnChange, callOnAllChangesDone,
145-
changeDetection
146-
}:{
147-
id?:string, selector?:string, compileChildren?:boolean, events?:List<string>, hostListeners?:Map<string, string>, hostProperties?:Map<string, string>,
148-
hostAttributes?:Map<string, string>, hostActions?:Map<string, string>, properties?:Map<string, string>, readAttributes?:List<string>, type?:number,
149-
callOnDestroy?:boolean, callOnChange?:boolean, callOnAllChangesDone?:boolean,
150-
changeDetection?:string
151-
}) {
143+
constructor({id, selector, compileChildren, events, hostListeners, hostProperties, hostAttributes,
144+
hostActions, properties, readAttributes, type, callOnDestroy, callOnChange,
145+
callOnAllChangesDone, changeDetection}: {
146+
id?: string,
147+
selector?: string,
148+
compileChildren?: boolean,
149+
events?: List<string>,
150+
hostListeners?: Map<string, string>,
151+
hostProperties?: Map<string, string>,
152+
hostAttributes?: Map<string, string>,
153+
hostActions?: Map<string, string>,
154+
properties?: Map<string, string>,
155+
readAttributes?: List<string>,
156+
type?: number,
157+
callOnDestroy?: boolean,
158+
callOnChange?: boolean,
159+
callOnAllChangesDone?: boolean,
160+
changeDetection?: string
161+
}) {
152162
this.id = id;
153163
this.selector = selector;
154164
this.compileChildren = isPresent(compileChildren) ? compileChildren : true;
@@ -179,11 +189,12 @@ export class ViewDefinition {
179189
template: string;
180190
directives: List<DirectiveMetadata>;
181191

182-
constructor({
183-
componentId, absUrl, template, directives
184-
}:{
185-
componentId?:string, absUrl?:string, template?:string, directives?:List<DirectiveMetadata>
186-
}) {
192+
constructor({componentId, absUrl, template, directives}: {
193+
componentId?: string,
194+
absUrl?: string,
195+
template?: string,
196+
directives?: List<DirectiveMetadata>
197+
}) {
187198
this.componentId = componentId;
188199
this.absUrl = absUrl;
189200
this.template = template;

modules/angular2/src/render/dom/view/element_binder.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,18 @@ export class ElementBinder {
1616
propertySetters: Map<string, SetterFn>;
1717
hostActions: Map<string, AST>;
1818

19-
constructor({
20-
textNodeIndices,
21-
contentTagSelector,
22-
nestedProtoView,
23-
componentId,
24-
eventLocals,
25-
localEvents,
26-
globalEvents,
27-
hostActions,
28-
parentIndex,
29-
distanceToParent,
30-
propertySetters
31-
}:{
19+
constructor({textNodeIndices, contentTagSelector, nestedProtoView, componentId, eventLocals,
20+
localEvents, globalEvents, hostActions, parentIndex, distanceToParent,
21+
propertySetters}: {
3222
contentTagSelector?: string,
3323
textNodeIndices?: List<number>,
3424
nestedProtoView?: protoViewModule.DomProtoView,
3525
eventLocals?: AST,
3626
localEvents?: List<Event>,
3727
globalEvents?: List<Event>,
3828
componentId?: string,
39-
parentIndex?:number,
40-
distanceToParent?:number,
29+
parentIndex?: number,
30+
distanceToParent?: number,
4131
propertySetters?: Map<string, SetterFn>,
4232
hostActions?: Map<string, AST>
4333
} = {}) {

modules/angular2/src/test_lib/test_bed.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ export class TestBed {
7777
* @return {Promise<ViewProxy>}
7878
*/
7979
createView(component: Type,
80-
{context = null,
81-
html = null}: {context?: any, html?: string} = {}): Promise<ViewProxy> {
80+
{context = null, html = null}: {context?: any,
81+
html?: string} = {}): Promise<ViewProxy> {
8282
if (isBlank(component) && isBlank(context)) {
8383
throw new BaseException('You must specified at least a component or a context');
8484
}

modules/angular2/src/test_lib/test_lib.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,25 +72,25 @@ class BeforeEachRunner {
7272
// Reset the test bindings before each test
7373
jsmBeforeEach(() => { testBindings = []; });
7474

75-
function _describe(jsmFn, ... args) {
75+
function _describe(jsmFn, ...args) {
7676
var parentRunner = runnerStack.length === 0 ? null : runnerStack[runnerStack.length - 1];
7777
var runner = new BeforeEachRunner(parentRunner);
7878
runnerStack.push(runner);
79-
var suite = jsmFn(... args);
79+
var suite = jsmFn(...args);
8080
runnerStack.pop();
8181
return suite;
8282
}
8383

84-
export function describe(... args) {
85-
return _describe(jsmDescribe, ... args);
84+
export function describe(...args) {
85+
return _describe(jsmDescribe, ...args);
8686
}
8787

88-
export function ddescribe(... args) {
89-
return _describe(jsmDDescribe, ... args);
88+
export function ddescribe(...args) {
89+
return _describe(jsmDDescribe, ...args);
9090
}
9191

92-
export function xdescribe(... args) {
93-
return _describe(jsmXDescribe, ... args);
92+
export function xdescribe(...args) {
93+
return _describe(jsmXDescribe, ...args);
9494
}
9595

9696
export function beforeEach(fn) {
@@ -123,7 +123,7 @@ export function beforeEachBindings(fn) {
123123
jsmBeforeEach(() => {
124124
var bindings = fn();
125125
if (!bindings) return;
126-
testBindings = [... testBindings, ... bindings];
126+
testBindings = [...testBindings, ...bindings];
127127
});
128128
}
129129

@@ -142,7 +142,7 @@ function _it(jsmFn, name, fn) {
142142
return new AsyncTestCompleter(done);
143143
});
144144

145-
var injector = createTestInjector([... testBindings, completerBinding]);
145+
var injector = createTestInjector([...testBindings, completerBinding]);
146146
runner.run(injector);
147147

148148
if (!(fn instanceof FunctionWithParamTokens)) {

modules/angular2/src/util/decorators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {global} from 'angular2/src/facade/lang';
22

33
export function makeDecorator(annotationCls) {
4-
return function(... args) {
4+
return function(...args) {
55
var Reflect = global.Reflect;
66
if (!(Reflect && Reflect.getMetadata)) {
77
throw 'reflect-metadata shim is required when using class decorators';
@@ -20,7 +20,7 @@ export function makeDecorator(annotationCls) {
2020
}
2121

2222
export function makeParamDecorator(annotationCls): any {
23-
return function(... args) {
23+
return function(...args) {
2424
var Reflect = global.Reflect;
2525
if (!(Reflect && Reflect.getMetadata)) {
2626
throw 'reflect-metadata shim is required when using parameter decorators';

0 commit comments

Comments
 (0)