Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit d22a895

Browse files
committed
Merge pull request #118 from angular/clang-format
Re-format the source using clang-format.
2 parents aed8b74 + cf2c179 commit d22a895

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/main.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ export class Transpiler {
229229
}
230230

231231
hasAnnotation(decorators: ts.NodeArray<ts.Decorator>, name: string): boolean {
232-
return decorators && decorators.some((d) => {
232+
if (!decorators) return false;
233+
return decorators.some((d) => {
233234
var decName = Transpiler.ident(d.expression);
234235
if (decName === name) return true;
235236
if (d.expression.kind !== ts.SyntaxKind.CallExpression) return false;
@@ -327,7 +328,7 @@ export class Transpiler {
327328
isEmptyImport(n: ts.ImportDeclaration): boolean {
328329
var bindings = n.importClause.namedBindings;
329330
if (bindings.kind != ts.SyntaxKind.NamedImports) return false;
330-
return (<ts.NamedImports> bindings).elements.every(Transpiler.isIgnoredAnnotation);
331+
return (<ts.NamedImports>bindings).elements.every(Transpiler.isIgnoredAnnotation);
331332
}
332333

333334
filterImports(ns: ts.ImportOrExportSpecifier[]) {
@@ -423,7 +424,7 @@ export class Transpiler {
423424
}
424425
this.emit(')');
425426
}
426-
if (isConstCtor) {
427+
if (isConstCtor) {
427428
// Const ctors don't have bodies.
428429
this.emit(';');
429430
} else {
@@ -754,7 +755,8 @@ export class Transpiler {
754755
this.emit(`'''${this.escapeTextForTemplateString(node)}`); //highlighting bug:'
755756
break;
756757
case ts.SyntaxKind.TemplateTail:
757-
this.result += `${this.escapeTextForTemplateString(node)}'''`; //highlighting bug:'
758+
this.result += this.escapeTextForTemplateString(node);
759+
this.result += `'''`;
758760
break;
759761
case ts.SyntaxKind.TemplateSpan:
760762
var span = <ts.TemplateSpan>node;

test/DartTest.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,8 @@ describe('transpile to dart', () => {
585585
chai.expect(transpiler.getLibraryName('a/x.ts')).to.equal('a.x');
586586
chai.expect(transpiler.getLibraryName('a/x.js')).to.equal('a.x');
587587
});
588-
it('handles non word characters', () => {
589-
chai.expect(transpiler.getLibraryName('a/%x.ts')).to.equal('a._x');
590-
});
588+
it('handles non word characters',
589+
() => { chai.expect(transpiler.getLibraryName('a/%x.ts')).to.equal('a._x'); });
591590
});
592591
});
593592

0 commit comments

Comments
 (0)