Skip to content

Commit a6e7123

Browse files
committed
feat: adjust formatting for clang-format v1.0.19.
1 parent 1c2abbc commit a6e7123

Some content is hidden

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

50 files changed

+376
-363
lines changed
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
export class Test {
22
firstItem;
3-
constructor() {
4-
this.doStuff();
5-
}
6-
otherMethod() {
7-
8-
}
9-
doStuff() {
10-
11-
}
3+
constructor() { this.doStuff(); }
4+
otherMethod() {}
5+
doStuff() {}
126
}

docs/dgeni-package/mocks/testSrc.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,15 @@ export class MyClass {
2020
* Create a new MyClass
2121
* @param {String} name The name to say hello to
2222
*/
23-
constructor(name) {
24-
this.message = 'hello ' + name;
25-
}
23+
constructor(name) { this.message = 'hello ' + name; }
2624

2725
/**
2826
* Return a greeting message
2927
*/
30-
greet() {
31-
return this.message;
32-
}
28+
greet() { return this.message; }
3329
}
3430

3531
/**
3632
* An exported function
3733
*/
38-
export var myFn = (val:number) => return val*2;
34+
export var myFn = (val: number) => return val * 2;

modules/angular2/src/change_detection/coalesce.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ function _selfRecord(r: ProtoRecord, contextIndex: number, selfIndex: number): P
4545

4646
function _findMatching(r: ProtoRecord, rs: List<ProtoRecord>) {
4747
return ListWrapper.find(rs, (rr) => rr.mode !== RecordType.DIRECTIVE_LIFECYCLE &&
48-
rr.mode === r.mode && rr.funcOrValue === r.funcOrValue &&
49-
rr.contextIndex === r.contextIndex &&
50-
ListWrapper.equals(rr.args, r.args));
48+
rr.mode === r.mode && rr.funcOrValue === r.funcOrValue &&
49+
rr.contextIndex === r.contextIndex &&
50+
ListWrapper.equals(rr.args, r.args));
5151
}
5252

5353
function _replaceIndices(r: ProtoRecord, selfIndex: number, indexMap: Map<any, any>) {

modules/angular2/src/change_detection/proto_record.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,20 @@ import {BindingRecord} from './binding_record';
33
import {DirectiveIndex} from './directive_record';
44

55
export enum RecordType {
6-
SELF, CONST, PRIMITIVE_OP, PROPERTY, LOCAL, INVOKE_METHOD, INVOKE_CLOSURE, KEYED_ACCESS, PIPE,
7-
BINDING_PIPE, INTERPOLATE, SAFE_PROPERTY, SAFE_INVOKE_METHOD, DIRECTIVE_LIFECYCLE
6+
SELF,
7+
CONST,
8+
PRIMITIVE_OP,
9+
PROPERTY,
10+
LOCAL,
11+
INVOKE_METHOD,
12+
INVOKE_CLOSURE,
13+
KEYED_ACCESS,
14+
PIPE,
15+
BINDING_PIPE,
16+
INTERPOLATE,
17+
SAFE_PROPERTY,
18+
SAFE_INVOKE_METHOD,
19+
DIRECTIVE_LIFECYCLE
820
}
921

1022
export class ProtoRecord {

modules/angular2/src/core/application.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ function _injectorBindings(appComponentType): List<Type | Binding | List<any>> {
101101
[NgZone]),
102102
bind(ShadowDomStrategy)
103103
.toFactory((styleUrlResolver, doc) =>
104-
new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, doc.head),
104+
new EmulatedUnscopedShadowDomStrategy(styleUrlResolver, doc.head),
105105
[StyleUrlResolver, DOCUMENT_TOKEN]),
106106
DomRenderer,
107107
DefaultDomCompiler,

modules/angular2/src/core/compiler/proto_view_factory.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,18 @@ function _createProtoElementInjector(binderIndex, parentPeiWithDistance, renderE
348348
}
349349

350350
function _createElementBinder(protoView, boundElementIndex, renderElementBinder,
351-
protoElementInjector, componentDirectiveBinding, directiveBindings): ElementBinder {
351+
protoElementInjector, componentDirectiveBinding,
352+
directiveBindings): ElementBinder {
352353
var parent = null;
353354
if (renderElementBinder.parentIndex !== -1) {
354355
parent = protoView.elementBinders[renderElementBinder.parentIndex];
355356
}
356357

357-
var directiveVariableBindings = createDirectiveVariableBindings(renderElementBinder, directiveBindings);
358-
var elBinder = protoView.bindElement(parent, renderElementBinder.distanceToParent,
359-
protoElementInjector, directiveVariableBindings, componentDirectiveBinding);
358+
var directiveVariableBindings =
359+
createDirectiveVariableBindings(renderElementBinder, directiveBindings);
360+
var elBinder =
361+
protoView.bindElement(parent, renderElementBinder.distanceToParent, protoElementInjector,
362+
directiveVariableBindings, componentDirectiveBinding);
360363
protoView.bindEvent(renderElementBinder.eventBindings, boundElementIndex, -1);
361364
// variables
362365
// The view's locals needs to have a full set of variable names at construction time
@@ -369,8 +372,9 @@ function _createElementBinder(protoView, boundElementIndex, renderElementBinder,
369372
return elBinder;
370373
}
371374

372-
export function createDirectiveVariableBindings(renderElementBinder:renderApi.ElementBinder,
373-
directiveBindings:List<DirectiveBinding>): Map<String, number> {
375+
export function createDirectiveVariableBindings(
376+
renderElementBinder: renderApi.ElementBinder,
377+
directiveBindings: List<DirectiveBinding>): Map<String, number> {
374378
var directiveVariableBindings = MapWrapper.create();
375379
MapWrapper.forEach(renderElementBinder.variableBindings, (templateName, exportAs) => {
376380
var dirIndex = _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, exportAs);
@@ -388,7 +392,8 @@ function _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, e
388392

389393
if (_directiveExportAs(directive) == exportAs) {
390394
if (isPresent(matchedDirective)) {
391-
throw new BaseException(`More than one directive have exportAs = '${exportAs}'. Directives: [${matchedDirective.displayName}, ${directive.displayName}]`);
395+
throw new BaseException(
396+
`More than one directive have exportAs = '${exportAs}'. Directives: [${matchedDirective.displayName}, ${directive.displayName}]`);
392397
}
393398

394399
matchedDirectiveIndex = i;
@@ -403,9 +408,10 @@ function _findDirectiveIndexByExportAs(renderElementBinder, directiveBindings, e
403408
return matchedDirectiveIndex;
404409
}
405410

406-
function _directiveExportAs(directive):string {
411+
function _directiveExportAs(directive): string {
407412
var directiveExportAs = directive.metadata.exportAs;
408-
if (isBlank(directiveExportAs) && directive.metadata.type === renderApi.DirectiveMetadata.COMPONENT_TYPE) {
413+
if (isBlank(directiveExportAs) &&
414+
directive.metadata.type === renderApi.DirectiveMetadata.COMPONENT_TYPE) {
409415
return "$implicit";
410416
} else {
411417
return directiveExportAs;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ export class NgZone {
143143
errorHandling = StringMapWrapper.merge(Zone.longStackTraceZone,
144144
{onError: function(e) { ngZone._onError(this, e) }});
145145
} else {
146-
errorHandling = {
147-
onError: function(e) { ngZone._onError(this, e) }
148-
};
146+
errorHandling = {onError: function(e) { ngZone._onError(this, e) }};
149147
}
150148

151149
return zone.fork(errorHandling)

modules/angular2/src/facade/lang.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export function normalizeBlank(obj) {
240240
return isBlank(obj) ? null : obj;
241241
}
242242

243-
export function normalizeBool(obj:boolean):boolean {
243+
export function normalizeBool(obj: boolean): boolean {
244244
return isBlank(obj) ? false : obj;
245245
}
246246

modules/angular2/src/http/enums.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

2-
export enum RequestModesOpts { Cors, NoCors, SameOrigin };
2+
export enum RequestModesOpts {Cors, NoCors, SameOrigin};
33

4-
export enum RequestCacheOpts { Default, NoStore, Reload, NoCache, ForceCache, OnlyIfCached };
4+
export enum RequestCacheOpts {Default, NoStore, Reload, NoCache, ForceCache, OnlyIfCached};
55

6-
export enum RequestCredentialsOpts { Omit, SameOrigin, Include };
6+
export enum RequestCredentialsOpts {Omit, SameOrigin, Include};
77

8-
export enum RequestMethods { GET, POST, PUT, DELETE, OPTIONS, HEAD };
8+
export enum RequestMethods {GET, POST, PUT, DELETE, OPTIONS, HEAD};
99

10-
export enum ReadyStates { UNSENT, OPEN, HEADERS_RECEIVED, LOADING, DONE, CANCELLED };
10+
export enum ReadyStates {UNSENT, OPEN, HEADERS_RECEIVED, LOADING, DONE, CANCELLED};
1111

12-
export enum ResponseTypes { Basic, Cors, Default, Error, Opaque }
12+
export enum ResponseTypes {Basic, Cors, Default, Error, Opaque}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class DomProtoView {
3939
(isPresent(this.element) && DOM.hasClass(this.element, NG_BINDING_CLASS)) ? 1 : 0;
4040
this.boundTextNodeCount =
4141
ListWrapper.reduce(elementBinders, (prevCount: number, elementBinder: ElementBinder) =>
42-
prevCount + elementBinder.textNodeIndices.length,
42+
prevCount + elementBinder.textNodeIndices.length,
4343
0);
4444
this.rootNodeCount =
4545
this.isTemplateElement ? DOM.childNodes(DOM.content(this.element)).length : 1;

0 commit comments

Comments
 (0)