Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

Commit 698b028

Browse files
josephperrottatscott
authored andcommitted
build: reformat repo to new clang@1.4.0 (angular#36613)
PR Close angular#36613
1 parent 5e80e7e commit 698b028

File tree

1,160 files changed

+31240
-23573
lines changed

Some content is hidden

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

1,160 files changed

+31240
-23573
lines changed

dev-infra/ts-circular-dependencies/analyzer.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import * as ts from 'typescript';
1313
import {getFileStatus} from './file_system';
1414
import {getModuleReferences} from './parser';
1515

16-
export type ModuleResolver = (specifier: string) => string | null;
16+
export type ModuleResolver = (specifier: string) => string|null;
1717

1818
/**
1919
* Reference chains describe a sequence of source files which are connected through imports.
@@ -69,7 +69,7 @@ export class Analyzer {
6969
getSourceFile(filePath: string): ts.SourceFile {
7070
const resolvedPath = resolve(filePath);
7171
if (this._sourceFileCache.has(resolvedPath)) {
72-
return this._sourceFileCache.get(resolvedPath) !;
72+
return this._sourceFileCache.get(resolvedPath)!;
7373
}
7474
const fileContent = readFileSync(resolvedPath, 'utf8');
7575
const sourceFile =
@@ -105,7 +105,7 @@ export class Analyzer {
105105
if (!this.unresolvedFiles.has(originFilePath)) {
106106
this.unresolvedFiles.set(originFilePath, [specifier]);
107107
}
108-
this.unresolvedFiles.get(originFilePath) !.push(specifier);
108+
this.unresolvedFiles.get(originFilePath)!.push(specifier);
109109
}
110110

111111
/** Resolves the given import specifier to the corresponding source file. */

dev-infra/utils/config.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ export function getAngularDevConfig<K, T>(): DevInfraConfig<K, T> {
4444
* Interface exressing the expected structure of the DevInfraConfig.
4545
* Allows for providing a typing for a part of the config to read.
4646
*/
47-
export interface DevInfraConfig<K, T> { [K: string]: T; }
47+
export interface DevInfraConfig<K, T> {
48+
[K: string]: T;
49+
}

goldens/public-api/core/core.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ export declare function ɵɵstyleSanitizer(sanitizer: StyleSanitizeFn | null): v
10641064

10651065
export declare function ɵɵtemplate(index: number, templateFn: ComponentTemplate<any> | null, decls: number, vars: number, tagName?: string | null, attrsIndex?: number | null, localRefsIndex?: number | null, localRefExtractor?: LocalRefExtractor): void;
10661066

1067-
export declare function ɵɵtemplateRefExtractor(tNode: TNode, currentView: ɵangular_packages_core_core_bp): TemplateRef<unknown> | null;
1067+
export declare function ɵɵtemplateRefExtractor(tNode: TNode, currentView: ɵangular_packages_core_core_bo): TemplateRef<unknown> | null;
10681068

10691069
export declare function ɵɵtext(index: number, value?: string): void;
10701070

modules/benchmarks/src/bootstrap_ng2.ts

+70-68
Original file line numberDiff line numberDiff line change
@@ -8,77 +8,79 @@
88

99
(function(global: any) {
1010

11-
writeScriptTag('/all/benchmarks/vendor/core.js');
12-
writeScriptTag('/all/benchmarks/vendor/zone.js');
13-
writeScriptTag('/all/benchmarks/vendor/long-stack-trace-zone.js');
14-
writeScriptTag('/all/benchmarks/vendor/system.src.js');
15-
writeScriptTag('/all/benchmarks/vendor/Reflect.js', 'benchmarksBootstrap()');
11+
writeScriptTag('/all/benchmarks/vendor/core.js');
12+
writeScriptTag('/all/benchmarks/vendor/zone.js');
13+
writeScriptTag('/all/benchmarks/vendor/long-stack-trace-zone.js');
14+
writeScriptTag('/all/benchmarks/vendor/system.src.js');
15+
writeScriptTag('/all/benchmarks/vendor/Reflect.js', 'benchmarksBootstrap()');
1616

17-
(<any>global).benchmarksBootstrap = benchmarksBootstrap;
17+
(<any>global).benchmarksBootstrap = benchmarksBootstrap;
1818

19-
function benchmarksBootstrap() {
20-
// check query param
21-
const useBundles = location.search.indexOf('bundles=false') == -1;
22-
if (useBundles) {
23-
System.config({
24-
defaultJSExtensions: true,
25-
map: {
26-
'@angular/core': '/packages-dist/core/bundles/core.umd.js',
27-
'@angular/animations': '/packages-dist/common/bundles/animations.umd.js',
28-
'@angular/platform-browser/animations':
29-
'/packages-dist/platform-browser/bundles/platform-browser-animations.umd.js',
30-
'@angular/common': '/packages-dist/common/bundles/common.umd.js',
31-
'@angular/forms': '/packages-dist/forms/bundles/forms.umd.js',
32-
'@angular/compiler': '/packages-dist/compiler/bundles/compiler.umd.js',
33-
'@angular/platform-browser':
34-
'/packages-dist/platform-browser/bundles/platform-browser.umd.js',
35-
'@angular/platform-browser-dynamic':
36-
'/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
37-
'@angular/http': '/packages-dist/http/bundles/http.umd.js',
38-
'@angular/upgrade': '/packages-dist/upgrade/bundles/upgrade.umd.js',
39-
'@angular/router': '/packages-dist/router/bundles/router.umd.js',
40-
'rxjs': '/all/benchmarks/vendor/rxjs',
41-
},
42-
packages: {
43-
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js'},
44-
'rxjs/operators': {main: 'index.js', defaultExtension: 'js'},
45-
'rxjs/testing': {main: 'index.js', defaultExtension: 'js'},
46-
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js'},
47-
'rxjs': {main: 'index.js', defaultExtension: 'js'},
48-
}
49-
});
50-
} else {
51-
console.warn(
52-
'Not using the Angular bundles. Don\'t use this configuration for e2e/performance tests!');
19+
function benchmarksBootstrap() {
20+
// check query param
21+
const useBundles = location.search.indexOf('bundles=false') == -1;
22+
if (useBundles) {
23+
System.config({
24+
defaultJSExtensions: true,
25+
map: {
26+
'@angular/core': '/packages-dist/core/bundles/core.umd.js',
27+
'@angular/animations': '/packages-dist/common/bundles/animations.umd.js',
28+
'@angular/platform-browser/animations':
29+
'/packages-dist/platform-browser/bundles/platform-browser-animations.umd.js',
30+
'@angular/common': '/packages-dist/common/bundles/common.umd.js',
31+
'@angular/forms': '/packages-dist/forms/bundles/forms.umd.js',
32+
'@angular/compiler': '/packages-dist/compiler/bundles/compiler.umd.js',
33+
'@angular/platform-browser':
34+
'/packages-dist/platform-browser/bundles/platform-browser.umd.js',
35+
'@angular/platform-browser-dynamic':
36+
'/packages-dist/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
37+
'@angular/http': '/packages-dist/http/bundles/http.umd.js',
38+
'@angular/upgrade': '/packages-dist/upgrade/bundles/upgrade.umd.js',
39+
'@angular/router': '/packages-dist/router/bundles/router.umd.js',
40+
'rxjs': '/all/benchmarks/vendor/rxjs',
41+
},
42+
packages: {
43+
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js'},
44+
'rxjs/operators': {main: 'index.js', defaultExtension: 'js'},
45+
'rxjs/testing': {main: 'index.js', defaultExtension: 'js'},
46+
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js'},
47+
'rxjs': {main: 'index.js', defaultExtension: 'js'},
48+
}
49+
});
50+
} else {
51+
console.warn(
52+
'Not using the Angular bundles. Don\'t use this configuration for e2e/performance tests!');
5353

54-
System.config({
55-
defaultJSExtensions: true,
56-
map: {'@angular': '/all/@angular', 'rxjs': '/all/benchmarks/vendor/rxjs'},
57-
packages: {
58-
'@angular/core': {main: 'index.js', defaultExtension: 'js'},
59-
'@angular/animations': {main: 'index.js', defaultExtension: 'js'},
60-
'@angular/platform-browser/animations': {main: 'index.js', defaultExtension: 'js'},
61-
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
62-
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
63-
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
64-
'@angular/forms': {main: 'index.js', defaultExtension: 'js'},
65-
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
66-
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
67-
'@angular/upgrade': {main: 'index.js', defaultExtension: 'js'},
68-
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js'},
69-
'rxjs/operators': {main: 'index.js', defaultExtension: 'js'},
70-
'rxjs/testing': {main: 'index.js', defaultExtension: 'js'},
71-
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js'},
72-
'rxjs': {main: 'index.js', defaultExtension: 'js'},
73-
}
74-
});
75-
}
76-
77-
// BOOTSTRAP the app!
78-
System.import('index').then(function(m: any) { m.main(); }, console.error.bind(console));
54+
System.config({
55+
defaultJSExtensions: true,
56+
map: {'@angular': '/all/@angular', 'rxjs': '/all/benchmarks/vendor/rxjs'},
57+
packages: {
58+
'@angular/core': {main: 'index.js', defaultExtension: 'js'},
59+
'@angular/animations': {main: 'index.js', defaultExtension: 'js'},
60+
'@angular/platform-browser/animations': {main: 'index.js', defaultExtension: 'js'},
61+
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
62+
'@angular/router': {main: 'index.js', defaultExtension: 'js'},
63+
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
64+
'@angular/forms': {main: 'index.js', defaultExtension: 'js'},
65+
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
66+
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'},
67+
'@angular/upgrade': {main: 'index.js', defaultExtension: 'js'},
68+
'rxjs/ajax': {main: 'index.js', defaultExtension: 'js'},
69+
'rxjs/operators': {main: 'index.js', defaultExtension: 'js'},
70+
'rxjs/testing': {main: 'index.js', defaultExtension: 'js'},
71+
'rxjs/websocket': {main: 'index.js', defaultExtension: 'js'},
72+
'rxjs': {main: 'index.js', defaultExtension: 'js'},
73+
}
74+
});
7975
}
8076

81-
function writeScriptTag(scriptUrl: string, onload?: string) {
82-
document.write(`<script src="${scriptUrl}" onload="${onload}"></script>`);
83-
}
77+
// BOOTSTRAP the app!
78+
System.import('index').then(function(m: any) {
79+
m.main();
80+
}, console.error.bind(console));
81+
}
82+
83+
function writeScriptTag(scriptUrl: string, onload?: string) {
84+
document.write(`<script src="${scriptUrl}" onload="${onload}"></script>`);
85+
}
8486
}(window));

modules/benchmarks/src/bootstrap_plain.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88

99
(function(global: any) {
1010

11-
writeScriptTag('/all/benchmarks/vendor/core.js');
12-
writeScriptTag('/all/benchmarks/vendor/system.src.js', 'benchmarksBootstrap()');
11+
writeScriptTag('/all/benchmarks/vendor/core.js');
12+
writeScriptTag('/all/benchmarks/vendor/system.src.js', 'benchmarksBootstrap()');
1313

14-
(<any>global).benchmarksBootstrap = benchmarksBootstrap;
14+
(<any>global).benchmarksBootstrap = benchmarksBootstrap;
1515

16-
function benchmarksBootstrap() {
17-
System.config({
18-
defaultJSExtensions: true,
19-
map: {'incremental-dom': '/all/benchmarks/vendor/incremental-dom-cjs.js'}
20-
});
16+
function benchmarksBootstrap() {
17+
System.config({
18+
defaultJSExtensions: true,
19+
map: {'incremental-dom': '/all/benchmarks/vendor/incremental-dom-cjs.js'}
20+
});
2121

22-
// BOOTSTRAP the app!
23-
System.import('index').then(function(m: any) {
24-
m.main && m.main();
25-
}, console.error.bind(console));
26-
}
22+
// BOOTSTRAP the app!
23+
System.import('index').then(function(m: any) {
24+
m.main && m.main();
25+
}, console.error.bind(console));
26+
}
2727

28-
function writeScriptTag(scriptUrl: string, onload?: string) {
29-
document.write(`<script src="${scriptUrl}" onload="${onload}"></script>`);
30-
}
28+
function writeScriptTag(scriptUrl: string, onload?: string) {
29+
document.write(`<script src="${scriptUrl}" onload="${onload}"></script>`);
30+
}
3131
}(window));

modules/benchmarks/src/change_detection/change_detection.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {openBrowser, verifyNoBrowserErrors} from '../../../e2e_util/e2e_util';
1313
describe('change detection benchmark', () => {
1414
afterEach(verifyNoBrowserErrors);
1515

16-
it(`should render and update`, async() => {
16+
it(`should render and update`, async () => {
1717
openBrowser({
1818
url: '',
1919
ignoreBrowserSynchronization: true,

modules/benchmarks/src/change_detection/change_detection.perf-spec.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ const UpdateWorker: Worker = {
3131
// name. We determine the name of the Bazel package where this test runs from the current test
3232
// target. The Bazel target
3333
// looks like: "//modules/benchmarks/src/change_detection/{pkg_name}:{target_name}".
34-
const testPackageName = process.env['BAZEL_TARGET'] !.split(':')[0].split('/').pop();
34+
const testPackageName = process.env['BAZEL_TARGET']!.split(':')[0].split('/').pop();
3535

3636
describe('change detection benchmark perf', () => {
37-
3837
afterEach(verifyNoBrowserErrors);
3938

4039
[UpdateWorker].forEach((worker) => {
4140
describe(worker.id, () => {
42-
it(`should run benchmark for ${testPackageName}`, async() => {
41+
it(`should run benchmark for ${testPackageName}`, async () => {
4342
await runChangeDetectionBenchmark({
4443
id: `change_detection.${testPackageName}.${worker.id}`,
4544
url: '/',

modules/benchmarks/src/change_detection/transplanted_views/init.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export function init(moduleRef: NgModuleRef<TransplantedViewsModule>) {
3535
appRef.tick();
3636
}
3737

38-
function detectChanges() { appRef.tick(); }
38+
function detectChanges() {
39+
appRef.tick();
40+
}
3941

4042
function noop() {}
4143
}

modules/benchmarks/src/change_detection/transplanted_views/transplanted_views.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ export class InsertionComponent {
4040
@Input() template !: TemplateRef<{}>;
4141
views: any[] = [];
4242
@Input()
43-
set viewCount(n: number) { this.views = n > 0 ? newArray<any>(n) : []; }
43+
set viewCount(n: number) {
44+
this.views = n > 0 ? newArray<any>(n) : [];
45+
}
4446

4547
// use trackBy to ensure profile isn't affected by the cost to refresh ngFor.
46-
trackByIndex(index: number, item: any) { return index; }
48+
trackByIndex(index: number, item: any) {
49+
return index;
50+
}
4751
}
4852

4953
@NgModule({

modules/benchmarks/src/change_detection/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function newArray<T>(size: number, value: T): T[];
1515
export function newArray<T>(size: number, value?: T): T[] {
1616
const list: T[] = [];
1717
for (let i = 0; i < size; i++) {
18-
list.push(value !);
18+
list.push(value!);
1919
}
2020
return list;
2121
}

modules/benchmarks/src/class_bindings/app.component.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,16 @@ export class AppComponent {
2727
}
2828
}
2929

30-
create() { this.show = true; }
30+
create() {
31+
this.show = true;
32+
}
3133

3234
update() {
3335
this.msg = this.msg === 'hello' ? 'bye' : 'hello';
3436
this.list[0].text = this.msg;
3537
}
3638

37-
destroy() { this.show = false; }
39+
destroy() {
40+
this.show = false;
41+
}
3842
}

modules/benchmarks/src/class_bindings/class_bindings.perf-spec.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import {$, browser} from 'protractor';
1010
import {runBenchmark} from '../../../e2e_util/perf_util';
1111

1212
describe('class bindings perf', () => {
13-
14-
it('should work for update', async() => {
13+
it('should work for update', async () => {
1514
browser.rootEl = '#root';
1615
await runBenchmark({
1716
id: 'create',
@@ -23,7 +22,7 @@ describe('class bindings perf', () => {
2322
});
2423
});
2524

26-
it('should work for update', async() => {
25+
it('should work for update', async () => {
2726
browser.rootEl = '#root';
2827
await runBenchmark({
2928
id: 'update',
@@ -34,5 +33,4 @@ describe('class bindings perf', () => {
3433
work: () => $('#update').click()
3534
});
3635
});
37-
3836
});

modules/benchmarks/src/expanding_rows/benchmark.ts

+21-8
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,32 @@ import {BenchmarkableExpandingRowModule} from './benchmarkable_expanding_row_mod
3131
</benchmark-area>`,
3232
})
3333
export class InitializationRoot implements AfterViewInit {
34-
@ViewChild(BenchmarkableExpandingRow, {static: true})
35-
expandingRow !: BenchmarkableExpandingRow;
34+
@ViewChild(BenchmarkableExpandingRow, {static: true}) expandingRow!: BenchmarkableExpandingRow;
3635

3736
ngAfterViewInit() {}
3837

39-
reset() { this.expandingRow.reset(); }
38+
reset() {
39+
this.expandingRow.reset();
40+
}
4041

41-
init() { this.expandingRow.init(); }
42+
init() {
43+
this.expandingRow.init();
44+
}
4245

4346
async runAll() {
44-
await execTimed('initialization_benchmark', async() => { await this.doInit(); });
47+
await execTimed('initialization_benchmark', async () => {
48+
await this.doInit();
49+
});
4550
}
4651

47-
async handleInitClick() { await this.doInit(); }
52+
async handleInitClick() {
53+
await this.doInit();
54+
}
4855

4956
private async doInit() {
50-
await execTimed('initial_load', async() => { this.expandingRow.init(); });
57+
await execTimed('initial_load', async () => {
58+
this.expandingRow.init();
59+
});
5160
}
5261
}
5362

@@ -74,5 +83,9 @@ export async function execTimed(description: string, func: () => Promise<void>)
7483
}
7584

7685
export async function nextTick(delay = 1) {
77-
return new Promise((res, rej) => { setTimeout(() => { res(); }, delay); });
86+
return new Promise((res, rej) => {
87+
setTimeout(() => {
88+
res();
89+
}, delay);
90+
});
7891
}

0 commit comments

Comments
 (0)