chore: clang-format after various changes.

This commit is contained in:
Martin Probst 2016-04-28 23:28:13 -07:00
parent 713e6d4aff
commit 365be6a309
14 changed files with 171 additions and 188 deletions

View File

@ -18,4 +18,4 @@ export {ROUTER_PROVIDERS} from './src/alt_router/router_providers';
import {RouterOutlet} from './src/alt_router/directives/router_outlet'; import {RouterOutlet} from './src/alt_router/directives/router_outlet';
import {RouterLink} from './src/alt_router/directives/router_link'; import {RouterLink} from './src/alt_router/directives/router_link';
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/ [RouterOutlet, RouterLink]; export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink];

View File

@ -38,10 +38,10 @@ import {XHR} from 'angular2/compiler';
/** /**
* An array of providers that should be passed into `application()` when bootstrapping a component. * An array of providers that should be passed into `application()` when bootstrapping a component.
*/ */
export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/ [ export const BROWSER_APP_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/[
BROWSER_APP_COMMON_PROVIDERS, BROWSER_APP_COMMON_PROVIDERS,
COMPILER_PROVIDERS, COMPILER_PROVIDERS,
/*@ts2dart_Provider*/{provide: XHR, useClass: XHRImpl}, /*@ts2dart_Provider*/ {provide: XHR, useClass: XHRImpl},
]; ];
export function browserPlatform(): PlatformRef { export function browserPlatform(): PlatformRef {

View File

@ -53,24 +53,24 @@ export const TEST_BROWSER_STATIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider
]; ];
export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [ /*@ts2dart_const*/[
/*@ts2dart_Provider*/{provide: APP_ID, useValue: 'a'}, /*@ts2dart_Provider*/ {provide: APP_ID, useValue: 'a'},
ELEMENT_PROBE_PROVIDERS, ELEMENT_PROBE_PROVIDERS,
/*@ts2dart_Provider*/{provide: DirectiveResolver, useClass: MockDirectiveResolver}, /*@ts2dart_Provider*/ {provide: DirectiveResolver, useClass: MockDirectiveResolver},
/*@ts2dart_Provider*/{provide: ViewResolver, useClass: MockViewResolver}, /*@ts2dart_Provider*/ {provide: ViewResolver, useClass: MockViewResolver},
Log, Log,
TestComponentBuilder, TestComponentBuilder,
/*@ts2dart_Provider*/{provide: NgZone, useFactory: createNgZone}, /*@ts2dart_Provider*/ {provide: NgZone, useFactory: createNgZone},
/*@ts2dart_Provider*/{provide: LocationStrategy, useClass: MockLocationStrategy}, /*@ts2dart_Provider*/ {provide: LocationStrategy, useClass: MockLocationStrategy},
/*@ts2dart_Provider*/{provide: AnimationBuilder, useClass: MockAnimationBuilder}, /*@ts2dart_Provider*/ {provide: AnimationBuilder, useClass: MockAnimationBuilder},
]; ];
/** /**
* Default application providers for testing without a compiler. * Default application providers for testing without a compiler.
*/ */
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [ /*@ts2dart_const*/[
BROWSER_APP_COMMON_PROVIDERS, BROWSER_APP_COMMON_PROVIDERS,
/*@ts2dart_Provider*/{provide: XHR, useClass: XHRImpl}, /*@ts2dart_Provider*/ {provide: XHR, useClass: XHRImpl},
ADDITIONAL_TEST_BROWSER_PROVIDERS ADDITIONAL_TEST_BROWSER_PROVIDERS
]; ];

View File

@ -39,7 +39,8 @@ function _createCompilerConfig() {
* A set of providers that provide `RuntimeCompiler` and its dependencies to use for * A set of providers that provide `RuntimeCompiler` and its dependencies to use for
* template compilation. * template compilation.
*/ */
export const COMPILER_PROVIDERS: Array<any | Type | {[k: string]: any} | any[]> = /*@ts2dart_const*/ [ export const COMPILER_PROVIDERS: Array<any | Type | {[k: string]: any} | any[]> =
/*@ts2dart_const*/[
Lexer, Lexer,
Parser, Parser,
HtmlParser, HtmlParser,
@ -49,13 +50,13 @@ export const COMPILER_PROVIDERS: Array<any | Type | {[k: string]: any} | any[]>
DEFAULT_PACKAGE_URL_PROVIDER, DEFAULT_PACKAGE_URL_PROVIDER,
StyleCompiler, StyleCompiler,
ViewCompiler, ViewCompiler,
/*@ts2dart_Provider*/{provide: CompilerConfig, useFactory: _createCompilerConfig, deps: []}, /*@ts2dart_Provider*/ {provide: CompilerConfig, useFactory: _createCompilerConfig, deps: []},
RuntimeCompiler, RuntimeCompiler,
/*@ts2dart_Provider*/{provide: ComponentResolver, useExisting: RuntimeCompiler}, /*@ts2dart_Provider*/ {provide: ComponentResolver, useExisting: RuntimeCompiler},
DomElementSchemaRegistry, DomElementSchemaRegistry,
/*@ts2dart_Provider*/{provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry}, /*@ts2dart_Provider*/ {provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry},
UrlResolver, UrlResolver,
ViewResolver, ViewResolver,
DirectiveResolver, DirectiveResolver,
PipeResolver PipeResolver
]; ];

View File

@ -437,10 +437,8 @@ export class ApplicationRef_ extends ApplicationRef {
export const PLATFORM_CORE_PROVIDERS = export const PLATFORM_CORE_PROVIDERS =
/*@ts2dart_const*/[ /*@ts2dart_const*/[
PlatformRef_, PlatformRef_,
/*@ts2dart_const*/ (/* @ts2dart_Provider */ { /*@ts2dart_const*/ (
provide: PlatformRef, /* @ts2dart_Provider */ {provide: PlatformRef, useExisting: PlatformRef_})
useExisting: PlatformRef_
})
]; ];
/** /**

View File

@ -69,7 +69,7 @@ export class ComponentRef_ extends ComponentRef {
onDestroy(callback: Function): void { this.hostView.onDestroy(callback); } onDestroy(callback: Function): void { this.hostView.onDestroy(callback); }
} }
const EMPTY_CONTEXT = /*@ts2dart_const*/new Object(); const EMPTY_CONTEXT = /*@ts2dart_const*/ new Object();
/*@ts2dart_const*/ /*@ts2dart_const*/
export class ComponentFactory { export class ComponentFactory {

View File

@ -54,10 +54,10 @@ export const BROWSER_PLATFORM_MARKER =
* *
* Used automatically by `bootstrap`, or can be passed to {@link platform}. * Used automatically by `bootstrap`, or can be passed to {@link platform}.
*/ */
export const BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/ [ export const BROWSER_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/[
/*@ts2dart_Provider*/{provide: BROWSER_PLATFORM_MARKER, useValue: true}, /*@ts2dart_Provider*/ {provide: BROWSER_PLATFORM_MARKER, useValue: true},
PLATFORM_COMMON_PROVIDERS, PLATFORM_COMMON_PROVIDERS,
/*@ts2dart_Provider*/{provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true}, /*@ts2dart_Provider*/ {provide: PLATFORM_INITIALIZER, useValue: initDomAdapter, multi: true},
]; ];
function _exceptionHandler(): ExceptionHandler { function _exceptionHandler(): ExceptionHandler {
@ -99,7 +99,7 @@ export const BROWSER_APP_COMMON_PROVIDERS: Array<any /*Type | Provider | any[]*/
]; ];
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> = export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [/*@ts2dart_Provider*/{provide: XHR, useClass: CachedXHR}]; /*@ts2dart_const*/[/*@ts2dart_Provider*/ {provide: XHR, useClass: CachedXHR}];
export function initDomAdapter() { export function initDomAdapter() {
BrowserDomAdapter.makeCurrent(); BrowserDomAdapter.makeCurrent();

View File

@ -37,10 +37,8 @@ export const WORKER_APP_PLATFORM_MARKER =
export const WORKER_APP_PLATFORM: Array<any /*Type | Provider | any[]*/> = export const WORKER_APP_PLATFORM: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/[ /*@ts2dart_const*/[
PLATFORM_COMMON_PROVIDERS, PLATFORM_COMMON_PROVIDERS,
/*@ts2dart_const*/ (/* @ts2dart_Provider */ { /*@ts2dart_const*/ (
provide: WORKER_APP_PLATFORM_MARKER, /* @ts2dart_Provider */ {provide: WORKER_APP_PLATFORM_MARKER, useValue: true})
useValue: true
})
]; ];
export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> = export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> =

View File

@ -31,10 +31,8 @@ import {PlatformLocation} from 'angular2/platform/common';
*/ */
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[ export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
ROUTER_PROVIDERS_COMMON, ROUTER_PROVIDERS_COMMON,
/*@ts2dart_const*/ (/* @ts2dart_Provider */ { /*@ts2dart_const*/ (
provide: PlatformLocation, /* @ts2dart_Provider */ {provide: PlatformLocation, useClass: BrowserPlatformLocation}),
useClass: BrowserPlatformLocation
}),
]; ];
/** /**

View File

@ -251,7 +251,8 @@ export function main() {
expect(car).toBe(sportsCar); expect(car).toBe(sportsCar);
}); });
it('should support multiProviders', () => { it(
'should support multiProviders', () => {
var injector = createInjector([ var injector = createInjector([
Engine, Engine,
/* @ts2dart_Provider */ {provide: Car, useClass: SportsCar, multi: true}, /* @ts2dart_Provider */ {provide: Car, useClass: SportsCar, multi: true},
@ -264,10 +265,12 @@ export function main() {
expect(cars[1]).toBeAnInstanceOf(CarWithOptionalEngine); expect(cars[1]).toBeAnInstanceOf(CarWithOptionalEngine);
}); });
it('should support multiProviders that are created using useExisting', it('should support multiProviders that are created using useExisting', () => {
() => { var injector = createInjector([
var injector = createInjector( Engine,
[Engine, SportsCar, /* @ts2dart_Provider */ {provide: Car, useExisting: SportsCar, multi: true}]); SportsCar,
/* @ts2dart_Provider */ {provide: Car, useExisting: SportsCar, multi: true}
]);
var cars = injector.get(Car); var cars = injector.get(Car);
expect(cars.length).toEqual(1); expect(cars.length).toEqual(1);
@ -513,7 +516,8 @@ export function main() {
}); });
}); });
describe('resolve', () => { describe('resolve',
() => {
it('should resolve and flatten', () => { it('should resolve and flatten', () => {
var providers = ReflectiveInjector.resolve([Engine, [BrokenEngine]]); var providers = ReflectiveInjector.resolve([Engine, [BrokenEngine]]);
providers.forEach(function(b) { providers.forEach(function(b) {
@ -522,7 +526,8 @@ export function main() {
}); });
}); });
it("should support multi providers", () => { it("should support multi providers",
() => {
var provider = ReflectiveInjector.resolve([ var provider = ReflectiveInjector.resolve([
/* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true}, /* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true},
/* @ts2dart_Provider */ {provide: Engine, useClass: TurboEngine, multi: true} /* @ts2dart_Provider */ {provide: Engine, useClass: TurboEngine, multi: true}
@ -534,7 +539,8 @@ export function main() {
}); });
it("should support providers as hash", () => { it("should support providers as hash",
() => {
var provider = ReflectiveInjector.resolve([ var provider = ReflectiveInjector.resolve([
/* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true}, /* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true},
/* @ts2dart_Provider */ {provide: Engine, useClass: TurboEngine, multi: true} /* @ts2dart_Provider */ {provide: Engine, useClass: TurboEngine, multi: true}
@ -547,11 +553,7 @@ export function main() {
it("should support multi providers with only one provider", () => { it("should support multi providers with only one provider", () => {
var provider = ReflectiveInjector.resolve([ var provider = ReflectiveInjector.resolve([
/* @ts2dart_Provider */ { /* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true}
provide: Engine,
useClass: BrokenEngine,
multi: true
}
])[0]; ])[0];
expect(provider.key.token).toBe(Engine); expect(provider.key.token).toBe(Engine);
@ -559,27 +561,18 @@ export function main() {
expect(provider.resolvedFactories.length).toEqual(1); expect(provider.resolvedFactories.length).toEqual(1);
}); });
it("should throw when mixing multi providers with regular providers", it("should throw when mixing multi providers with regular providers", () => {
() => {
expect(() => { expect(() => {
ReflectiveInjector.resolve([ ReflectiveInjector.resolve([
/* @ts2dart_Provider */ { /* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true},
provide: Engine,
useClass: BrokenEngine,
multi: true
},
Engine Engine
]); ]);
}) }).toThrowErrorWith("Cannot mix multi providers and regular providers");
.toThrowErrorWith(
"Cannot mix multi providers and regular providers");
expect(() => { expect(() => {
ReflectiveInjector.resolve( ReflectiveInjector.resolve(
[Engine, /* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true}]); [Engine, /* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true}]);
}) }).toThrowErrorWith("Cannot mix multi providers and regular providers");
.toThrowErrorWith(
"Cannot mix multi providers and regular providers");
}); });
it('should resolve forward references', () => { it('should resolve forward references', () => {
@ -595,14 +588,17 @@ export function main() {
var stringProvider = providers[2]; var stringProvider = providers[2];
expect(engineProvider.resolvedFactories[0].factory() instanceof Engine).toBe(true); expect(engineProvider.resolvedFactories[0].factory() instanceof Engine).toBe(true);
expect(brokenEngineProvider.resolvedFactories[0].factory() instanceof Engine).toBe(true); expect(brokenEngineProvider.resolvedFactories[0].factory() instanceof Engine)
.toBe(true);
expect(stringProvider.resolvedFactories[0].dependencies[0].key) expect(stringProvider.resolvedFactories[0].dependencies[0].key)
.toEqual(ReflectiveKey.get(Engine)); .toEqual(ReflectiveKey.get(Engine));
}); });
it('should support overriding factory dependencies with dependency annotations', () => { it('should support overriding factory dependencies with dependency annotations',
() => {
var providers = ReflectiveInjector.resolve([ var providers = ReflectiveInjector.resolve([
provide("token", provide(
"token",
{ {
useFactory: (e) => "result", useFactory: (e) => "result",
deps: [[new InjectMetadata("dep"), new CustomDependencyMetadata()]] deps: [[new InjectMetadata("dep"), new CustomDependencyMetadata()]]

View File

@ -1071,7 +1071,7 @@ export function main() {
}); });
} }
const ALL_DIRECTIVES = /*@ts2dart_const*/ [ const ALL_DIRECTIVES = /*@ts2dart_const*/[
forwardRef(() => TestDirective), forwardRef(() => TestDirective),
forwardRef(() => TestComponent), forwardRef(() => TestComponent),
forwardRef(() => AnotherComponent), forwardRef(() => AnotherComponent),
@ -1084,7 +1084,7 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/ [
forwardRef(() => OrderCheckDirective1), forwardRef(() => OrderCheckDirective1),
]; ];
const ALL_PIPES = /*@ts2dart_const*/ [ const ALL_PIPES = /*@ts2dart_const*/[
forwardRef(() => CountingPipe), forwardRef(() => CountingPipe),
forwardRef(() => CountingImpurePipe), forwardRef(() => CountingImpurePipe),
forwardRef(() => MultiArgPipe), forwardRef(() => MultiArgPipe),

View File

@ -2273,11 +2273,7 @@ class PublicApi {
@Directive({ @Directive({
selector: '[public-api]', selector: '[public-api]',
providers: [ providers: [
/* @ts2dart_Provider */ { /* @ts2dart_Provider */ {provide: PublicApi, useExisting: PrivateImpl, deps: []}
provide: PublicApi,
useExisting: PrivateImpl,
deps: []
}
] ]
}) })
@Injectable() @Injectable()
@ -2379,10 +2375,8 @@ class DirectiveProvidingInjectableInView {
@Component({ @Component({
selector: 'directive-providing-injectable', selector: 'directive-providing-injectable',
providers: providers: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'host'}],
[/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'host'}], viewProviders: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'view'}],
viewProviders:
[/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'view'}],
template: '' template: ''
}) })
@Injectable() @Injectable()
@ -2433,10 +2427,7 @@ class EventBus {
@Directive({ @Directive({
selector: 'grand-parent-providing-event-bus', selector: 'grand-parent-providing-event-bus',
providers: [ providers: [
/* @ts2dart_Provider */ { /* @ts2dart_Provider */ {provide: EventBus, useValue: new EventBus(null, "grandparent")}
provide: EventBus,
useValue: new EventBus(null, "grandparent")
}
] ]
}) })
class GrandParentProvidingEventBus { class GrandParentProvidingEventBus {

View File

@ -49,7 +49,7 @@ import {
import {NgIf} from 'angular2/common'; import {NgIf} from 'angular2/common';
import {DOM} from 'angular2/src/platform/dom/dom_adapter'; import {DOM} from 'angular2/src/platform/dom/dom_adapter';
const ALL_DIRECTIVES = /*@ts2dart_const*/ [ const ALL_DIRECTIVES = /*@ts2dart_const*/[
forwardRef(() => SimpleDirective), forwardRef(() => SimpleDirective),
forwardRef(() => CycleDirective), forwardRef(() => CycleDirective),
forwardRef(() => SimpleComponent), forwardRef(() => SimpleComponent),
@ -83,7 +83,7 @@ const ALL_DIRECTIVES = /*@ts2dart_const*/ [
NgIf NgIf
]; ];
const ALL_PIPES = /*@ts2dart_const*/ [ const ALL_PIPES = /*@ts2dart_const*/[
forwardRef(() => PipeNeedsChangeDetectorRef), forwardRef(() => PipeNeedsChangeDetectorRef),
forwardRef(() => PipeNeedsService), forwardRef(() => PipeNeedsService),
forwardRef(() => PurePipe), forwardRef(() => PurePipe),

View File

@ -71,7 +71,8 @@ function getSourceTree(options: AngularBuilderOptions) {
'**/*.js', '**/*.js',
'**/*.ts', '**/*.ts',
'**/*.dart' '**/*.dart'
], [ ],
[
'rollup-test/**/*', 'rollup-test/**/*',
'angular1_router/**/*', 'angular1_router/**/*',
'angular2/upgrade/**/*', 'angular2/upgrade/**/*',