chore: clang-format after various changes.
This commit is contained in:
parent
713e6d4aff
commit
365be6a309
@ -39,7 +39,8 @@ function _createCompilerConfig() {
|
||||
* A set of providers that provide `RuntimeCompiler` and its dependencies to use for
|
||||
* 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,
|
||||
Parser,
|
||||
HtmlParser,
|
||||
|
@ -437,10 +437,8 @@ export class ApplicationRef_ extends ApplicationRef {
|
||||
export const PLATFORM_CORE_PROVIDERS =
|
||||
/*@ts2dart_const*/[
|
||||
PlatformRef_,
|
||||
/*@ts2dart_const*/ (/* @ts2dart_Provider */ {
|
||||
provide: PlatformRef,
|
||||
useExisting: PlatformRef_
|
||||
})
|
||||
/*@ts2dart_const*/ (
|
||||
/* @ts2dart_Provider */ {provide: PlatformRef, useExisting: PlatformRef_})
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -37,10 +37,8 @@ export const WORKER_APP_PLATFORM_MARKER =
|
||||
export const WORKER_APP_PLATFORM: Array<any /*Type | Provider | any[]*/> =
|
||||
/*@ts2dart_const*/[
|
||||
PLATFORM_COMMON_PROVIDERS,
|
||||
/*@ts2dart_const*/ (/* @ts2dart_Provider */ {
|
||||
provide: WORKER_APP_PLATFORM_MARKER,
|
||||
useValue: true
|
||||
})
|
||||
/*@ts2dart_const*/ (
|
||||
/* @ts2dart_Provider */ {provide: WORKER_APP_PLATFORM_MARKER, useValue: true})
|
||||
];
|
||||
|
||||
export const WORKER_APP_APPLICATION_COMMON: Array<any /*Type | Provider | any[]*/> =
|
||||
|
@ -31,10 +31,8 @@ import {PlatformLocation} from 'angular2/platform/common';
|
||||
*/
|
||||
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
|
||||
ROUTER_PROVIDERS_COMMON,
|
||||
/*@ts2dart_const*/ (/* @ts2dart_Provider */ {
|
||||
provide: PlatformLocation,
|
||||
useClass: BrowserPlatformLocation
|
||||
}),
|
||||
/*@ts2dart_const*/ (
|
||||
/* @ts2dart_Provider */ {provide: PlatformLocation, useClass: BrowserPlatformLocation}),
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -251,7 +251,8 @@ export function main() {
|
||||
expect(car).toBe(sportsCar);
|
||||
});
|
||||
|
||||
it('should support multiProviders', () => {
|
||||
it(
|
||||
'should support multiProviders', () => {
|
||||
var injector = createInjector([
|
||||
Engine,
|
||||
/* @ts2dart_Provider */ {provide: Car, useClass: SportsCar, multi: true},
|
||||
@ -264,10 +265,12 @@ export function main() {
|
||||
expect(cars[1]).toBeAnInstanceOf(CarWithOptionalEngine);
|
||||
});
|
||||
|
||||
it('should support multiProviders that are created using useExisting',
|
||||
() => {
|
||||
var injector = createInjector(
|
||||
[Engine, SportsCar, /* @ts2dart_Provider */ {provide: Car, useExisting: SportsCar, multi: true}]);
|
||||
it('should support multiProviders that are created using useExisting', () => {
|
||||
var injector = createInjector([
|
||||
Engine,
|
||||
SportsCar,
|
||||
/* @ts2dart_Provider */ {provide: Car, useExisting: SportsCar, multi: true}
|
||||
]);
|
||||
|
||||
var cars = injector.get(Car);
|
||||
expect(cars.length).toEqual(1);
|
||||
@ -513,7 +516,8 @@ export function main() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolve', () => {
|
||||
describe('resolve',
|
||||
() => {
|
||||
it('should resolve and flatten', () => {
|
||||
var providers = ReflectiveInjector.resolve([Engine, [BrokenEngine]]);
|
||||
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([
|
||||
/* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, 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([
|
||||
/* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, 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", () => {
|
||||
var provider = ReflectiveInjector.resolve([
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: Engine,
|
||||
useClass: BrokenEngine,
|
||||
multi: true
|
||||
}
|
||||
/* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true}
|
||||
])[0];
|
||||
|
||||
expect(provider.key.token).toBe(Engine);
|
||||
@ -559,27 +561,18 @@ export function main() {
|
||||
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(() => {
|
||||
ReflectiveInjector.resolve([
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: Engine,
|
||||
useClass: BrokenEngine,
|
||||
multi: true
|
||||
},
|
||||
/* @ts2dart_Provider */ {provide: Engine, useClass: BrokenEngine, multi: true},
|
||||
Engine
|
||||
]);
|
||||
})
|
||||
.toThrowErrorWith(
|
||||
"Cannot mix multi providers and regular providers");
|
||||
}).toThrowErrorWith("Cannot mix multi providers and regular providers");
|
||||
|
||||
expect(() => {
|
||||
ReflectiveInjector.resolve(
|
||||
[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', () => {
|
||||
@ -595,14 +588,17 @@ export function main() {
|
||||
var stringProvider = providers[2];
|
||||
|
||||
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)
|
||||
.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([
|
||||
provide("token",
|
||||
provide(
|
||||
"token",
|
||||
{
|
||||
useFactory: (e) => "result",
|
||||
deps: [[new InjectMetadata("dep"), new CustomDependencyMetadata()]]
|
||||
|
@ -2273,11 +2273,7 @@ class PublicApi {
|
||||
@Directive({
|
||||
selector: '[public-api]',
|
||||
providers: [
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: PublicApi,
|
||||
useExisting: PrivateImpl,
|
||||
deps: []
|
||||
}
|
||||
/* @ts2dart_Provider */ {provide: PublicApi, useExisting: PrivateImpl, deps: []}
|
||||
]
|
||||
})
|
||||
@Injectable()
|
||||
@ -2379,10 +2375,8 @@ class DirectiveProvidingInjectableInView {
|
||||
|
||||
@Component({
|
||||
selector: 'directive-providing-injectable',
|
||||
providers:
|
||||
[/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'host'}],
|
||||
viewProviders:
|
||||
[/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'view'}],
|
||||
providers: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'host'}],
|
||||
viewProviders: [/* @ts2dart_Provider */ {provide: InjectableService, useValue: 'view'}],
|
||||
template: ''
|
||||
})
|
||||
@Injectable()
|
||||
@ -2433,10 +2427,7 @@ class EventBus {
|
||||
@Directive({
|
||||
selector: 'grand-parent-providing-event-bus',
|
||||
providers: [
|
||||
/* @ts2dart_Provider */ {
|
||||
provide: EventBus,
|
||||
useValue: new EventBus(null, "grandparent")
|
||||
}
|
||||
/* @ts2dart_Provider */ {provide: EventBus, useValue: new EventBus(null, "grandparent")}
|
||||
]
|
||||
})
|
||||
class GrandParentProvidingEventBus {
|
||||
|
@ -71,7 +71,8 @@ function getSourceTree(options: AngularBuilderOptions) {
|
||||
'**/*.js',
|
||||
'**/*.ts',
|
||||
'**/*.dart'
|
||||
], [
|
||||
],
|
||||
[
|
||||
'rollup-test/**/*',
|
||||
'angular1_router/**/*',
|
||||
'angular2/upgrade/**/*',
|
||||
|
Loading…
x
Reference in New Issue
Block a user