refactor: change provide(...) for {provide: ...}
- provide() is deprecated, - {} syntax is required by the offline compiler
This commit is contained in:
@ -10,9 +10,6 @@ import {
|
||||
Component,
|
||||
Directive,
|
||||
ViewContainerRef,
|
||||
bind,
|
||||
provide,
|
||||
Provider,
|
||||
ViewMetadata
|
||||
} from '@angular/core';
|
||||
|
||||
@ -20,19 +17,19 @@ import {CompilerConfig, ViewResolver} from '@angular/compiler';
|
||||
|
||||
import {getIntParameter, bindAction} from '@angular/testing/src/benchmark_util';
|
||||
|
||||
function _createBindings(): Provider[] {
|
||||
function _createBindings(): any[] {
|
||||
var multiplyTemplatesBy = getIntParameter('elements');
|
||||
return [
|
||||
provide(ViewResolver,
|
||||
{
|
||||
useFactory: () => new MultiplyViewResolver(
|
||||
{
|
||||
provide: ViewResolver,
|
||||
useFactory: () => new MultiplyViewResolver(
|
||||
multiplyTemplatesBy,
|
||||
[BenchmarkComponentNoBindings, BenchmarkComponentWithBindings]),
|
||||
deps: []
|
||||
}),
|
||||
deps: []
|
||||
},
|
||||
// Use interpretative mode as Dart does not support JIT and
|
||||
// we want to be able to compare the numbers between JS and Dart
|
||||
provide(CompilerConfig, {useValue: new CompilerConfig(false, false, false)})
|
||||
{provide: CompilerConfig, useValue: new CompilerConfig(false, false, false)}
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {Injectable, ReflectiveInjector, ReflectiveKey, bind, provide} from '@angular/core';
|
||||
import {Injectable, ReflectiveInjector, ReflectiveKey} from '@angular/core';
|
||||
import {reflector} from '@angular/core/src/reflection/reflection';
|
||||
import {ReflectionCapabilities} from '@angular/core/src/reflection/reflection_capabilities';
|
||||
import {getIntParameter, bindAction, microBenchmark} from '@angular/testing/src/benchmark_util';
|
||||
@ -27,7 +27,7 @@ export function main() {
|
||||
.resolveAndCreateChild([])
|
||||
.resolveAndCreateChild([]);
|
||||
|
||||
var variousProviders = [A, provide(B, {useClass: C}), [D, [E]], provide(F, {useValue: 6})];
|
||||
var variousProviders = [A, {provide: B, useClass: C}, [D, [E]], {provide: F, useValue: 6}];
|
||||
|
||||
var variousProvidersResolved = ReflectiveInjector.resolve(variousProviders);
|
||||
|
||||
|
@ -8,7 +8,7 @@ import {
|
||||
windowProfileEnd
|
||||
} from '@angular/testing/src/benchmark_util';
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {Component, Directive, bind, provide} from '@angular/core';
|
||||
import {Component} from '@angular/core';
|
||||
import {NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from '@angular/common';
|
||||
import {ApplicationRef} from '@angular/core/src/application_ref';
|
||||
import {BrowserDomAdapter} from '@angular/platform-browser/src/browser/browser_adapter';
|
||||
@ -24,9 +24,9 @@ export const LARGETABLE_COLS = 'LargetableComponent.cols';
|
||||
|
||||
function _createBindings() {
|
||||
return [
|
||||
provide(BENCHMARK_TYPE, {useValue: getStringParameter('benchmarkType')}),
|
||||
provide(LARGETABLE_ROWS, {useValue: getIntParameter('rows')}),
|
||||
provide(LARGETABLE_COLS, {useValue: getIntParameter('columns')})
|
||||
{provide: BENCHMARK_TYPE, useValue: getStringParameter('benchmarkType')},
|
||||
{provide: LARGETABLE_ROWS, useValue: getIntParameter('rows')},
|
||||
{provide: LARGETABLE_COLS, {useValue: getIntParameter('columns')},
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {NgIf} from '@angular/common';
|
||||
import {Component, Directive, ViewContainerRef, bind, provide, Provider} from '@angular/core';
|
||||
import {Component} from '@angular/core';
|
||||
import {ApplicationRef} from '@angular/core/src/application_ref';
|
||||
import {reflector} from '@angular/core/src/reflection/reflection';
|
||||
import {ReflectionCapabilities} from '@angular/core/src/reflection/reflection_capabilities';
|
||||
@ -15,7 +15,7 @@ import {
|
||||
} from '@angular/testing/src/benchmark_util';
|
||||
import {BrowserDomAdapter} from '@angular/platform-browser/src/browser/browser_adapter';
|
||||
|
||||
function createBindings(): Provider[] {
|
||||
function createBindings(): any[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,6 @@
|
||||
import {bootstrap} from '@angular/platform-browser';
|
||||
import {
|
||||
Component,
|
||||
Directive,
|
||||
ViewContainerRef,
|
||||
bind,
|
||||
provide,
|
||||
Provider,
|
||||
enableProdMode
|
||||
} from '@angular/core';
|
||||
import {NgIf} from '@angular/common';
|
||||
@ -23,7 +18,7 @@ import {
|
||||
} from '@angular/testing/src/benchmark_util';
|
||||
import {BrowserDomAdapter} from '@angular/platform-browser/src/browser/browser_adapter';
|
||||
|
||||
function createProviders(): Provider[] {
|
||||
function createProviders(): any[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user