chore: move to clang-format 1.0.17.
clang-format 1.0.17 substantially improves formatting for fat arrow functions and array literal detection. It also fixes a number of minor formatting issues.
This commit is contained in:
@ -77,8 +77,7 @@ export function main() {
|
||||
}
|
||||
|
||||
function captureDirective(directive): Promise<renderApi.DirectiveMetadata> {
|
||||
return captureTemplate(
|
||||
new viewAnn.View({template: '<div></div>', directives: [directive]}))
|
||||
return captureTemplate(new viewAnn.View({template: '<div></div>', directives: [directive]}))
|
||||
.then((renderTpl) => {
|
||||
expect(renderTpl.directives.length).toBe(1);
|
||||
return renderTpl.directives[0];
|
||||
@ -315,9 +314,11 @@ export function main() {
|
||||
createProtoView([createComponentElementBinder(directiveResolver, NestedComponent)]);
|
||||
var nestedProtoView = createProtoView();
|
||||
var compiler = createCompiler([
|
||||
createRenderProtoView([createRenderViewportElementBinder(
|
||||
createRenderProtoView([createRenderComponentElementBinder(0)],
|
||||
renderApi.ProtoViewDto.EMBEDDED_VIEW_TYPE))]),
|
||||
createRenderProtoView([
|
||||
createRenderViewportElementBinder(
|
||||
createRenderProtoView([createRenderComponentElementBinder(0)],
|
||||
renderApi.ProtoViewDto.EMBEDDED_VIEW_TYPE))
|
||||
]),
|
||||
createRenderProtoView()
|
||||
],
|
||||
[[mainProtoView, viewportProtoView], [nestedProtoView]]);
|
||||
@ -336,11 +337,10 @@ export function main() {
|
||||
var expectedProtoView = createProtoView();
|
||||
var compiler = createCompiler([renderProtoView], [[expectedProtoView]]);
|
||||
compiler.compile(MainComponent)
|
||||
.then((protoViewRef) =>
|
||||
{
|
||||
expect(internalProtoView(protoViewRef)).toBe(expectedProtoView);
|
||||
return compiler.compile(MainComponent);
|
||||
})
|
||||
.then((protoViewRef) => {
|
||||
expect(internalProtoView(protoViewRef)).toBe(expectedProtoView);
|
||||
return compiler.compile(MainComponent);
|
||||
})
|
||||
.then((protoViewRef) => {
|
||||
expect(internalProtoView(protoViewRef)).toBe(expectedProtoView);
|
||||
async.done();
|
||||
|
@ -76,31 +76,27 @@ export function main() {
|
||||
view.context.ctxBoolProp = true;
|
||||
view.detectChanges();
|
||||
var dynamicComponent = view.rawView.viewContainers[0].views[0].locals.get("dynamic");
|
||||
dynamicComponent.done.then((_) =>
|
||||
{
|
||||
view.detectChanges();
|
||||
expect(view.rootNodes).toHaveText('hello');
|
||||
var promise = dynamicComponent.done.then((_) => {
|
||||
view.detectChanges();
|
||||
expect(view.rootNodes).toHaveText('hello');
|
||||
|
||||
view.context.ctxBoolProp = false;
|
||||
view.detectChanges();
|
||||
view.context.ctxBoolProp = false;
|
||||
view.detectChanges();
|
||||
|
||||
expect(view.rawView.viewContainers[0].views.length)
|
||||
.toBe(0);
|
||||
expect(view.rootNodes).toHaveText('');
|
||||
expect(view.rawView.viewContainers[0].views.length).toBe(0);
|
||||
expect(view.rootNodes).toHaveText('');
|
||||
|
||||
view.context.ctxBoolProp = true;
|
||||
view.detectChanges();
|
||||
view.context.ctxBoolProp = true;
|
||||
view.detectChanges();
|
||||
|
||||
var dynamicComponent =
|
||||
view.rawView.viewContainers[0].views[0].locals.get(
|
||||
"dynamic");
|
||||
return dynamicComponent.done;
|
||||
})
|
||||
.then((_) => {
|
||||
view.detectChanges();
|
||||
expect(view.rootNodes).toHaveText('hello');
|
||||
async.done();
|
||||
});
|
||||
var dynamicComponent = view.rawView.viewContainers[0].views[0].locals.get("dynamic");
|
||||
return dynamicComponent.done;
|
||||
});
|
||||
promise.then((_) => {
|
||||
view.detectChanges();
|
||||
expect(view.rootNodes).toHaveText('hello');
|
||||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
@ -112,8 +112,8 @@ export function main() {
|
||||
|
||||
it('should consume binding to aria-* attributes',
|
||||
inject([TestBed, AsyncTestCompleter], (tb, async) => {
|
||||
tb.overrideView(
|
||||
MyComp, new viewAnn.View({template: '<div [attr.aria-label]="ctxProp"></div>'}));
|
||||
tb.overrideView(MyComp,
|
||||
new viewAnn.View({template: '<div [attr.aria-label]="ctxProp"></div>'}));
|
||||
|
||||
tb.createView(MyComp, {context: ctx})
|
||||
.then((view) => {
|
||||
@ -234,10 +234,12 @@ export function main() {
|
||||
|
||||
describe('pipes', () => {
|
||||
beforeEachBindings(() => {
|
||||
return [bind(ChangeDetection)
|
||||
.toFactory(() => new DynamicChangeDetection(
|
||||
new PipeRegistry({"double": [new DoublePipeFactory()]})),
|
||||
[])];
|
||||
return [
|
||||
bind(ChangeDetection)
|
||||
.toFactory(() => new DynamicChangeDetection(
|
||||
new PipeRegistry({"double": [new DoublePipeFactory()]})),
|
||||
[])
|
||||
];
|
||||
});
|
||||
|
||||
it("should support pipes in bindings and bind config",
|
||||
@ -312,8 +314,8 @@ export function main() {
|
||||
|
||||
it('should support directives where a selector matches property binding',
|
||||
inject([TestBed, AsyncTestCompleter], (tb, async) => {
|
||||
tb.overrideView(MyComp, new viewAnn.View(
|
||||
{template: '<p [id]="ctxProp"></p>', directives: [IdDir]}));
|
||||
tb.overrideView(
|
||||
MyComp, new viewAnn.View({template: '<p [id]="ctxProp"></p>', directives: [IdDir]}));
|
||||
|
||||
tb.createView(MyComp, {context: ctx})
|
||||
.then((view) => {
|
||||
@ -1007,11 +1009,8 @@ export function main() {
|
||||
</parent-providing-event-bus>
|
||||
</grand-parent-providing-event-bus>
|
||||
`,
|
||||
directives: [
|
||||
GrandParentProvidingEventBus,
|
||||
ParentProvidingEventBus,
|
||||
ChildConsumingEventBus
|
||||
]
|
||||
directives:
|
||||
[GrandParentProvidingEventBus, ParentProvidingEventBus, ChildConsumingEventBus]
|
||||
}));
|
||||
tb.createView(MyComp, {context: ctx})
|
||||
.then((view) => {
|
||||
@ -1161,8 +1160,7 @@ export function main() {
|
||||
tb.overrideView(MyComp, new viewAnn.View({template: inlineTpl}));
|
||||
PromiseWrapper.then(
|
||||
tb.createView(MyComp),
|
||||
(value) =>
|
||||
{
|
||||
(value) => {
|
||||
throw new BaseException(
|
||||
"Test failure: should not have come here as an exception was expected");
|
||||
},
|
||||
@ -1638,11 +1636,15 @@ function createParentBusView(p) {
|
||||
}
|
||||
@Component({
|
||||
selector: 'parent-providing-event-bus',
|
||||
hostInjector: [new Binding(
|
||||
EventBus, {toFactory: createParentBusHost, deps: [[EventBus, new visAnn.Unbounded()]]})],
|
||||
viewInjector: [new Binding(
|
||||
EventBus,
|
||||
{toFactory: createParentBusView, deps: [[FORWARD_REF(() => ParentProvidingEventBus)]]})]
|
||||
hostInjector: [
|
||||
new Binding(EventBus,
|
||||
{toFactory: createParentBusHost, deps: [[EventBus, new visAnn.Unbounded()]]})
|
||||
],
|
||||
viewInjector: [
|
||||
new Binding(
|
||||
EventBus,
|
||||
{toFactory: createParentBusView, deps: [[FORWARD_REF(() => ParentProvidingEventBus)]]})
|
||||
]
|
||||
})
|
||||
@View({
|
||||
directives: [FORWARD_REF(() => ChildConsumingEventBus)],
|
||||
|
Reference in New Issue
Block a user