@@ -5,8 +5,6 @@ import {resolveForwardRef} from './forward_ref';
55
66export { TypeLiteral } from './type_literal' ;
77
8- // TODO: uncoment `int` once https://github.com/angular/angular/issues/1414 is fixed
9-
108/**
119 * A unique object used for retrieving items from the {@link Injector}.
1210 *
@@ -20,21 +18,16 @@ export {TypeLiteral} from './type_literal';
2018 * @exportedAs angular2/di
2119 */
2220export class Key {
23- token : Object ;
24- id : number ;
25-
2621 /**
2722 * @private
2823 */
29- constructor ( token : Object , id : number ) {
24+ constructor ( public token : Object , public id : number ) {
3025 if ( isBlank ( token ) ) {
3126 throw new BaseException ( 'Token must be defined!' ) ;
3227 }
33- this . token = token ;
34- this . id = id ;
3528 }
3629
37- get displayName ( ) { return stringify ( this . token ) ; }
30+ get displayName ( ) : string { return stringify ( this . token ) ; }
3831
3932 /**
4033 * Retrieves a `Key` for a token.
@@ -51,8 +44,7 @@ export class Key {
5144 * @private
5245 */
5346export class KeyRegistry {
54- _allKeys : Map < Object , Key > ;
55- constructor ( ) { this . _allKeys = MapWrapper . create ( ) ; }
47+ private _allKeys : Map < Object , Key > = MapWrapper . create ( ) ;
5648
5749 get ( token : Object ) : Key {
5850 if ( token instanceof Key ) return token ;
@@ -73,7 +65,7 @@ export class KeyRegistry {
7365 return newKey ;
7466 }
7567
76- get numberOfKeys ( ) /* :int */ { return MapWrapper . size ( this . _allKeys ) ; }
68+ get numberOfKeys ( ) : number { return MapWrapper . size ( this . _allKeys ) ; }
7769}
7870
7971var _globalKeyRegistry = new KeyRegistry ( ) ;
0 commit comments