fix benchmarks

This commit is contained in:
vsavkin
2015-10-08 09:57:10 -07:00
parent 8b725c77fd
commit d63f3c123e
17 changed files with 36 additions and 57 deletions

View File

@ -255,30 +255,26 @@ export class Binding {
* expect(injector.get('message')).toEqual('Hello');
* ```
*/
export abstract class ResolvedBinding {
export interface ResolvedBinding {
/**
* A key, usually a `Type`.
*/
public key: Key;
key: Key;
/**
* Factory function which can return an instance of an object represented by a key.
*/
public resolvedFactories: ResolvedFactory[];
resolvedFactories: ResolvedFactory[];
/**
* Indicates if the binding is a multi-binding or a regular binding.
*/
public multiBinding: boolean;
multiBinding: boolean;
}
export class ResolvedBinding_ extends ResolvedBinding {
constructor(key: Key, resolvedFactories: ResolvedFactory[], multiBinding: boolean) {
super();
this.key = key;
this.resolvedFactories = resolvedFactories;
this.multiBinding = multiBinding;
}
export class ResolvedBinding_ implements ResolvedBinding {
constructor(public key: Key, public resolvedFactories: ResolvedFactory[],
public multiBinding: boolean) {}
get resolvedFactory(): ResolvedFactory { return this.resolvedFactories[0]; }
}

View File

@ -134,17 +134,7 @@ export class CyclicDependencyError extends AbstractBindingError {
* }
* ```
*/
export abstract class InstantiationError extends WrappedException {
constructor(message, originalException, originalStack, context) {
super(message, originalException, originalStack, context);
}
abstract addKey(injector: Injector, key: Key): void;
get wrapperMessage(): string { return unimplemented(); };
get causeKey(): Key { return unimplemented(); };
get context() { return unimplemented(); };
}
export class InstantiationError_ extends InstantiationError {
export class InstantiationError extends WrappedException {
/** @internal */
keys: Key[];

View File

@ -13,7 +13,6 @@ import {
NoBindingError,
CyclicDependencyError,
InstantiationError,
InstantiationError_,
InvalidBindingError,
OutOfBoundsError,
MixingMultiBindingsWithRegularBindings
@ -866,7 +865,7 @@ export class Injector {
break;
}
} catch (e) {
throw new InstantiationError_(this, e, e.stack, binding.key);
throw new InstantiationError(this, e, e.stack, binding.key);
}
return obj;
}

View File

@ -2,7 +2,6 @@ import {isPresent, isString, StringWrapper, isBlank} from 'angular2/src/core/fac
import {DoCheck, OnDestroy} from 'angular2/lifecycle_hooks';
import {Directive} from 'angular2/src/core/metadata';
import {ElementRef} from 'angular2/src/core/linker';
import {ElementRef_} from '../linker/element_ref';
import {
IterableDiffer,
IterableDiffers,

View File

@ -7,7 +7,6 @@ import {ElementRef} from 'angular2/src/core/linker';
import {Directive} from 'angular2/src/core/metadata';
import {Renderer} from 'angular2/src/core/render';
import {isPresent, isBlank, print} from 'angular2/src/core/facade/lang';
import {ElementRef_} from "../linker/element_ref";
/**
* The `NgStyle` directive changes styles based on a result of expression evaluation.

View File

@ -14,6 +14,14 @@ import {ViewRef, HostViewRef} from './view_ref';
* method.
*/
export abstract class ComponentRef {
/**
* The injector provided {@link DynamicComponentLoader#loadAsRoot}.
*
* TODO(i): this api is useless and should be replaced by an injector retrieved from
* the HostElementRef, which is currently not possible.
*/
injector: Injector;
/**
* Location of the Host Element of this Component Instance.
*/
@ -54,14 +62,6 @@ export abstract class ComponentRef {
}
export class ComponentRef_ extends ComponentRef {
/**
* The injector provided {@link DynamicComponentLoader#loadAsRoot}.
*
* TODO(i): this api is useless and should be replaced by an injector retrieved from
* the HostElementRef, which is currently not possible.
*/
injector: Injector;
/**
* TODO(i): refactor into public/private fields
*/

View File

@ -115,7 +115,7 @@ export class ViewMetadata {
* }
* ```
*/
directives: Array<Type | Function | any[]>;
directives: Array<Type | any[]>;
pipes: Array<Type | any[]>;

View File

@ -13,12 +13,7 @@ import {Map} from 'angular2/src/core/facade/collection';
*
* <!-- TODO: this is created by Renderer#createProtoView in the new compiler -->
*/
export abstract class RenderProtoViewRef {}
export class RenderProtoViewRef_ extends RenderProtoViewRef {
constructor() { super(); }
}
export class RenderProtoViewRef {}
/**
* Represents a list of sibling Nodes that can be moved by the {@link Renderer} independently of