chore(build): Upgrade to TypeScript@1.5.3
This change also makes us compliant with 1.6.0-dev compiler, so we can do some experiments with apps that use 1.6 features and compile against Angular. We should probably add a travis build for 1.6 so we stay compatible with both versions.
This commit is contained in:
@ -1,13 +1,7 @@
|
||||
import {ComponentAnnotation, DirectiveAnnotation, LifecycleEvent} from './annotations';
|
||||
import {ViewAnnotation} from './view';
|
||||
import {AttributeAnnotation, QueryAnnotation, ViewQueryAnnotation} from './di';
|
||||
import {
|
||||
makeDecorator,
|
||||
makeParamDecorator,
|
||||
TypeDecorator,
|
||||
ParameterDecorator,
|
||||
Class
|
||||
} from '../../util/decorators';
|
||||
import {makeDecorator, makeParamDecorator, TypeDecorator, Class} from '../../util/decorators';
|
||||
import {Type} from 'angular2/src/facade/lang';
|
||||
import {ViewEncapsulation} from 'angular2/src/render/api';
|
||||
|
||||
|
@ -8,6 +8,9 @@ declare module Intl {
|
||||
currency?: string;
|
||||
currencyDisplay?: string;
|
||||
useGrouping?: boolean;
|
||||
minimumIntegerDigits?: number;
|
||||
minimumFractionDigits?: number;
|
||||
maximumFractionDigits?: number;
|
||||
}
|
||||
|
||||
interface NumberFormat {
|
||||
|
@ -59,18 +59,18 @@ export function CONST_EXPR<T>(expr: T): T {
|
||||
return expr;
|
||||
}
|
||||
|
||||
export function CONST():<T>(target: T) => T {
|
||||
export function CONST(): ClassDecorator {
|
||||
return (target) => target;
|
||||
}
|
||||
|
||||
export function ABSTRACT():<T>(target: T) => T {
|
||||
export function ABSTRACT(): ClassDecorator {
|
||||
return (t) => t;
|
||||
}
|
||||
|
||||
// Note: This is only a marker annotation needed for ts2dart.
|
||||
// This is written so that is can be used as a Traceur annotation
|
||||
// or a Typescript decorator.
|
||||
export function IMPLEMENTS(_):<T>(target: T) => T {
|
||||
export function IMPLEMENTS(_): ClassDecorator {
|
||||
return (t) => t;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import {List, ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {Location} from 'angular2/src/router/location';
|
||||
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(Location)
|
||||
export class SpyLocation extends SpyObject {
|
||||
urlChanges: List<string>;
|
||||
|
@ -22,10 +22,15 @@ export class Route implements RouteDefinition {
|
||||
path: string;
|
||||
component: Type;
|
||||
as: string;
|
||||
// added next two properties to work around https://github.com/Microsoft/TypeScript/issues/4107
|
||||
loader: Function;
|
||||
redirectTo: string;
|
||||
constructor({path, component, as}: {path: string, component: Type, as?: string}) {
|
||||
this.path = path;
|
||||
this.component = component;
|
||||
this.as = as;
|
||||
this.loader = null;
|
||||
this.redirectTo = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,32 +4,32 @@ import 'package:angular2/src/change_detection/change_detection.dart';
|
||||
import 'package:angular2/di.dart';
|
||||
import './test_lib.dart';
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
class SpyChangeDetector extends SpyObject implements ChangeDetector {
|
||||
noSuchMethod(m) => super.noSuchMethod(m);
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
class SpyProtoChangeDetector extends SpyObject implements ProtoChangeDetector {
|
||||
noSuchMethod(m) => super.noSuchMethod(m);
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
class SpyPipe extends SpyObject implements Pipe {
|
||||
noSuchMethod(m) => super.noSuchMethod(m);
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
class SpyPipeFactory extends SpyObject implements PipeFactory {
|
||||
noSuchMethod(m) => super.noSuchMethod(m);
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
class SpyDependencyProvider extends SpyObject implements DependencyProvider {
|
||||
noSuchMethod(m) => super.noSuchMethod(m);
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
class SpyChangeDetectorRef extends SpyObject implements ChangeDetectorRef {
|
||||
noSuchMethod(m) => super.noSuchMethod(m);
|
||||
}
|
||||
|
@ -12,7 +12,9 @@ import {createTestInjector, FunctionWithParamTokens, inject} from './test_inject
|
||||
|
||||
export {inject} from './test_injector';
|
||||
|
||||
export function proxy() {}
|
||||
export function proxy(): ClassDecorator {
|
||||
return (t) => t;
|
||||
}
|
||||
|
||||
var _global: jasmine.GlobalPolluter = <any>(typeof window === 'undefined' ? global : window);
|
||||
|
||||
|
@ -49,6 +49,12 @@ export interface TypeDecorator {
|
||||
*/
|
||||
<T extends Type>(type: T): T;
|
||||
|
||||
// Make TypeDecorator assignable to built-in ParameterDecorator type.
|
||||
// ParameterDecorator is declared in lib.d.ts as a `declare type`
|
||||
// so we cannot declare this interface as a subtype.
|
||||
// see https://github.com/angular/angular/issues/3379#issuecomment-126169417
|
||||
(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
|
||||
|
||||
/**
|
||||
* Storage for the accumulated annotations so far used by the DSL syntax.
|
||||
*
|
||||
@ -62,17 +68,6 @@ export interface TypeDecorator {
|
||||
Class(obj: ClassDefinition): Type;
|
||||
}
|
||||
|
||||
/**
|
||||
* An interface implemented by all Angular parameter decorators, which allows them to be used as ES7
|
||||
* decorators.
|
||||
*/
|
||||
export interface ParameterDecorator {
|
||||
/**
|
||||
* Invoke as ES7 decorator.
|
||||
*/
|
||||
(cls: Type, unusedKey: any, index: number): void;
|
||||
}
|
||||
|
||||
function extractAnnotation(annotation: any): any {
|
||||
if (isFunction(annotation) && annotation.hasOwnProperty('annotation')) {
|
||||
// it is a decorator, extract annotation
|
||||
|
Reference in New Issue
Block a user