build: reformat repo to new clang@1.4.0 (#36628)

PR Close #36628
This commit is contained in:
Joey Perrott
2020-04-13 17:43:52 -07:00
committed by atscott
parent 4b3f9ac739
commit 26f49151e7
1163 changed files with 31727 additions and 24036 deletions

View File

@ -78,7 +78,7 @@ const rootLView = createLView(
null, createTView(TViewType.Root, -1, null, 0, 0, null, null, null, null, null), {},
LViewFlags.IsRoot, null, null);
const viewTNode = createTNode(null !, null, TNodeType.View, -1, null, null) as TViewNode;
const viewTNode = createTNode(null!, null, TNodeType.View, -1, null, null) as TViewNode;
const embeddedTView = createTView(
TViewType.Embedded, -1, testTemplate, 21, 10, [Tooltip.ɵdir], null, null, null,
[['position', 'top', 3, 'tooltip']]);

View File

@ -1,10 +1,10 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ɵɵadvance} from '../../../../src/render3/instructions/advance';
import {ɵɵelement, ɵɵelementEnd, ɵɵelementStart} from '../../../../src/render3/instructions/element';
import {refreshView} from '../../../../src/render3/instructions/shared';

View File

@ -67,7 +67,7 @@ const rootLView = createLView(
null, createTView(TViewType.Root, -1, null, 0, 0, null, null, null, null, null), {},
LViewFlags.IsRoot, null, null);
const viewTNode = createTNode(null !, null, TNodeType.View, -1, null, null) as TViewNode;
const viewTNode = createTNode(null!, null, TNodeType.View, -1, null, null) as TViewNode;
const embeddedTView = createTView(
TViewType.Embedded, -1, testTemplate, 21, 0, null, null, null, null, [[
'name1', 'value1', 'name2', 'value2', 'name3', 'value3', 'name4', 'value4', 'name5', 'value5'

View File

@ -31,19 +31,24 @@ function generateHostBindingDirDef() {
}
`;
class HostBindingDir {
static ɵfac() { return new HostBindingDir(); }
static ɵfac() {
return new HostBindingDir();
}
static ɵdir = ɵɵdefineDirective({
type: HostBindingDir,
selectors: [['', 'hostBindingDir', '']],
hostVars: 2,
hostBindings: function(rf: RenderFlags, ctx: any) {
if (rf & 1) {
ɵɵlistener('click', function() { return ctx.onClick(); });
}
if (rf & 2) {
ɵɵhostProperty('data-a', ctx.exp);
}
}
hostBindings:
function(rf: RenderFlags, ctx: any) {
if (rf & 1) {
ɵɵlistener('click', function() {
return ctx.onClick();
});
}
if (rf & 2) {
ɵɵhostProperty('data-a', ctx.exp);
}
}
});
exp = 'string-exp';

View File

@ -69,7 +69,7 @@ const rootLView = createLView(
null, createTView(TViewType.Root, -1, null, 0, 0, null, null, null, null, null), {},
LViewFlags.IsRoot, null, null);
const viewTNode = createTNode(null !, null, TNodeType.View, -1, null, null) as TViewNode;
const viewTNode = createTNode(null!, null, TNodeType.View, -1, null, null) as TViewNode;
const embeddedTView = createTView(
TViewType.Embedded, -1, testTemplate, 11, 0, null, null, null, null, [[3, 'click', 'input']]);

View File

@ -64,8 +64,8 @@ export function createBenchmark(benchmarkName: string): Benchmark {
}
if (!runAgain) {
// tslint:disable-next-line:no-console
console.log(
` ${formatTime(profile.bestTime)} (count: ${profile.sampleCount}, iterations: ${profile.iterationCount})`);
console.log(` ${formatTime(profile.bestTime)} (count: ${
profile.sampleCount}, iterations: ${profile.iterationCount})`);
}
}
iterationCounter = profile.iterationCount;
@ -91,11 +91,14 @@ export function createBenchmark(benchmarkName: string): Benchmark {
return (previous.bestTime < current.bestTime) ? previous : current;
});
const unitOffset = findUnit(fastest.bestTime);
(fn || console.info)(`\nBenchmark: ${benchmarkName}\n${profiles.map((profile: Profile) => {
const time = formatTime(profile.bestTime, unitOffset);
const percent = formatPercent(1 - profile.bestTime / fastest.bestTime);
return ` ${profile.profileName}: ${time}(${percent}) `;
}).join('\n')}`);
(fn || console.info)(`\nBenchmark: ${benchmarkName}\n${
profiles
.map((profile: Profile) => {
const time = formatTime(profile.bestTime, unitOffset);
const percent = formatPercent(1 - profile.bestTime / fastest.bestTime);
return ` ${profile.profileName}: ${time}(${percent}) `;
})
.join('\n')}`);
};
return benchmark;
}

View File

@ -62,7 +62,7 @@ const rootLView = createLView(
null, createTView(TViewType.Root, -1, null, 0, 0, null, null, null, null, null), {},
LViewFlags.IsRoot, null, null);
const viewTNode = createTNode(null !, null, TNodeType.View, -1, null, null) as TViewNode;
const viewTNode = createTNode(null!, null, TNodeType.View, -1, null, null) as TViewNode;
const embeddedTView = createTView(
TViewType.Root, -1, testTemplate, 2, 0, [NgIfLike.ɵdir], null, null, null,
[['viewManipulation', '']]);

View File

@ -5,33 +5,49 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {ProceduralRenderer3, RComment, RElement, RNode, RText, Renderer3, RendererFactory3, RendererStyleFlags3} from '../../../src/render3/interfaces/renderer';
import {ProceduralRenderer3, RComment, RElement, Renderer3, RendererFactory3, RendererStyleFlags3, RNode, RText} from '../../../src/render3/interfaces/renderer';
export class MicroBenchmarkRenderNode implements RNode, RComment, RText {
textContent: string|null = null;
parentNode: RNode|null = null;
parentElement: RElement|null = null;
nextSibling: RNode|null = null;
removeChild(oldChild: RNode): RNode { return oldChild; }
removeChild(oldChild: RNode): RNode {
return oldChild;
}
insertBefore(newChild: RNode, refChild: RNode|null, isViewRoot: boolean): void {}
appendChild(newChild: RNode): RNode { return newChild; }
appendChild(newChild: RNode): RNode {
return newChild;
}
className: string = '';
}
export class MicroBenchmarkRenderer implements ProceduralRenderer3 {
destroy(): void { throw new Error('Method not implemented.'); }
createComment(value: string): RComment { return new MicroBenchmarkRenderNode(); }
destroy(): void {
throw new Error('Method not implemented.');
}
createComment(value: string): RComment {
return new MicroBenchmarkRenderNode();
}
createElement(name: string, namespace?: string|null|undefined): RElement {
return new MicroBenchmarkRenderNode() as any as RElement;
}
createText(value: string): RText { return new MicroBenchmarkRenderNode(); }
createText(value: string): RText {
return new MicroBenchmarkRenderNode();
}
destroyNode?: ((node: RNode) => void)|null|undefined;
appendChild(parent: RElement, newChild: RNode): void {}
insertBefore(parent: RNode, newChild: RNode, refChild: RNode|null): void {}
removeChild(parent: RElement, oldChild: RNode, isHostElement?: boolean|undefined): void {}
selectRootElement(selectorOrNode: any): RElement { throw new Error('Method not implemented.'); }
parentNode(node: RNode): RElement|null { throw new Error('Method not implemented.'); }
nextSibling(node: RNode): RNode|null { throw new Error('Method not implemented.'); }
selectRootElement(selectorOrNode: any): RElement {
throw new Error('Method not implemented.');
}
parentNode(node: RNode): RElement|null {
throw new Error('Method not implemented.');
}
nextSibling(node: RNode): RNode|null {
throw new Error('Method not implemented.');
}
setAttribute(el: RElement, name: string, value: string, namespace?: string|null|undefined): void {
if (name === 'class' && isOurNode(el)) {
el.className = value;
@ -51,7 +67,9 @@ export class MicroBenchmarkRenderer implements ProceduralRenderer3 {
setStyle(el: RElement, style: string, value: any, flags?: RendererStyleFlags3|undefined): void {}
removeStyle(el: RElement, style: string, flags?: RendererStyleFlags3|undefined): void {}
setProperty(el: RElement, name: string, value: any): void {}
setValue(node: RComment|RText, value: string): void { node.textContent = value; }
setValue(node: RComment|RText, value: string): void {
node.textContent = value;
}
listen(
target: RNode|'document'|'window'|'body', eventName: string,
callback: (event: any) => boolean | void): () => void {

View File

@ -8,7 +8,7 @@
import {ProceduralRenderer3} from '@angular/core/src/render3/interfaces/renderer';
import {MicroBenchmarkRenderNode, MicroBenchmarkRendererFactory} from './noop_renderer';
import {MicroBenchmarkRendererFactory, MicroBenchmarkRenderNode} from './noop_renderer';
describe('MicroBenchmarkRenderNode', () => {
const renderer =

View File

@ -8,7 +8,7 @@
import {addToViewTree, createLContainer, createLView, createTNode, createTView, getOrCreateTNode, refreshView, renderView} from '../../../src/render3/instructions/shared';
import {ComponentTemplate, DirectiveDefList} from '../../../src/render3/interfaces/definition';
import {TAttributes, TNodeType, TViewNode} from '../../../src/render3/interfaces/node';
import {RendererFactory3, domRendererFactory3} from '../../../src/render3/interfaces/renderer';
import {domRendererFactory3, RendererFactory3} from '../../../src/render3/interfaces/renderer';
import {LView, LViewFlags, TVIEW, TView, TViewType} from '../../../src/render3/interfaces/view';
import {insertView} from '../../../src/render3/node_manipulation';
@ -28,9 +28,9 @@ export function createAndRenderLView(
}
export function setupRootViewWithEmbeddedViews(
templateFn: ComponentTemplate<any>| null, decls: number, vars: number, noOfViews: number,
embeddedViewContext: any = {}, consts: TAttributes[] | null = null,
directiveRegistry: DirectiveDefList | null = null): LView {
templateFn: ComponentTemplate<any>|null, decls: number, vars: number, noOfViews: number,
embeddedViewContext: any = {}, consts: TAttributes[]|null = null,
directiveRegistry: DirectiveDefList|null = null): LView {
return setupTestHarness(
templateFn, decls, vars, noOfViews, embeddedViewContext, consts, directiveRegistry)
.hostLView;
@ -45,9 +45,9 @@ export interface TestHarness {
}
export function setupTestHarness(
templateFn: ComponentTemplate<any>| null, decls: number, vars: number, noOfViews: number,
embeddedViewContext: any = {}, consts: TAttributes[] | null = null,
directiveRegistry: DirectiveDefList | null = null): TestHarness {
templateFn: ComponentTemplate<any>|null, decls: number, vars: number, noOfViews: number,
embeddedViewContext: any = {}, consts: TAttributes[]|null = null,
directiveRegistry: DirectiveDefList|null = null): TestHarness {
// Create a root view with a container
const hostTView = createTView(TViewType.Root, -1, null, 1, 0, null, null, null, null, consts);
const tContainerNode = getOrCreateTNode(hostTView, null, 0, TNodeType.Container, null, null);

View File

@ -19,5 +19,7 @@ export function defineBenchmarkTestDirective(
}
class FakeDirectiveType {
static ɵfac = () => { return {}; };
static ɵfac = () => {
return {};
}
}

View File

@ -55,7 +55,7 @@ const rootLView = createLView(
null, createTView(TViewType.Root, -1, null, 0, 0, null, null, null, null, null), {},
LViewFlags.IsRoot, null, null);
const viewTNode = createTNode(null !, null, TNodeType.View, -1, null, null) as TViewNode;
const viewTNode = createTNode(null!, null, TNodeType.View, -1, null, null) as TViewNode;
const embeddedTView = createTView(
TViewType.Embedded, -1, testTemplate, 21, 10, [ToDestroy.ɵdir], null, null, null,
[['to-destroy']]);