refactor: change provide(...) for {provide: ...}

- provide() is deprecated,
- {} syntax is required by the offline compiler
This commit is contained in:
Victor Berchet
2016-06-02 17:30:40 -07:00
parent 27a47e7841
commit a6ad61d83e
128 changed files with 676 additions and 728 deletions

View File

@ -14,14 +14,14 @@ import {
import {isPresent, StringWrapper} from '@angular/facade';
import {PromiseWrapper} from '@angular/facade';
import {WebDriverExtension, bind, provide, ReflectiveInjector, Options} from 'benchpress/common';
import {WebDriverExtension, ReflectiveInjector, Options} from 'benchpress/common';
export function main() {
function createExtension(ids: any[], caps) {
return PromiseWrapper.wrap(() => {
return ReflectiveInjector.resolveAndCreate([
ids.map(id => provide(id, {useValue: new MockExtension(id)})),
bind(Options.CAPABILITIES).toValue(caps),
ids.map((id) => { return {provide: id, useValue: new MockExtension(id)}}),
{provide: Options.CAPABILITIES, useValue: caps},
WebDriverExtension.bindTo(ids)
])
.get(WebDriverExtension);