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:
@ -27,12 +27,7 @@ export {
|
||||
} from 'angular2/src/core/compiler/interfaces';
|
||||
|
||||
|
||||
export {
|
||||
Class,
|
||||
ClassDefinition,
|
||||
ParameterDecorator,
|
||||
TypeDecorator
|
||||
} from 'angular2/src/util/decorators';
|
||||
export {Class, ClassDefinition, TypeDecorator} from 'angular2/src/util/decorators';
|
||||
|
||||
export {
|
||||
Attribute,
|
||||
|
@ -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
|
||||
|
@ -117,7 +117,7 @@ export function main() {
|
||||
});
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(ChangeDetectorRef)
|
||||
class SpyChangeDetectorRef extends SpyObject {
|
||||
constructor() { super(ChangeDetectorRef); }
|
||||
|
@ -119,7 +119,7 @@ export function main() {
|
||||
});
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(ChangeDetectorRef)
|
||||
class SpyChangeDetectorRef extends SpyObject {
|
||||
constructor() { super(ChangeDetectorRef); }
|
||||
|
@ -658,14 +658,14 @@ class DirectiveWithAttributes {
|
||||
constructor(@Attribute('someAttr') someAttr: String) {}
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(RenderCompiler)
|
||||
class SpyRenderCompiler extends SpyObject {
|
||||
constructor() { super(RenderCompiler); }
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(DirectiveResolver)
|
||||
class SpyDirectiveResolver extends SpyObject {
|
||||
constructor() { super(DirectiveResolver); }
|
||||
@ -719,4 +719,4 @@ function collectEmbeddedPvs(pv: AppProtoView, target: AppProtoView[] = null): Ap
|
||||
}
|
||||
});
|
||||
return target;
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ import {ElementRef} from 'angular2/src/core/compiler/element_ref';
|
||||
import {DynamicChangeDetector, ChangeDetectorRef, Parser, Lexer} from 'angular2/src/change_detection/change_detection';
|
||||
import {QueryList} from 'angular2/src/core/compiler/query_list';
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(AppView)
|
||||
class DummyView extends SpyObject {
|
||||
changeDetector;
|
||||
@ -59,7 +59,7 @@ class DummyView extends SpyObject {
|
||||
noSuchMethod(m) { return super.noSuchMethod(m); }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(ElementRef)
|
||||
class DummyElementRef extends SpyObject {
|
||||
boundElementIndex: number = 0;
|
||||
|
@ -227,7 +227,7 @@ class ThrowingComponent2 {
|
||||
}
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
class PropModel implements Map {
|
||||
final String foo = 'foo-prop';
|
||||
|
||||
|
@ -199,7 +199,7 @@ function createRenderViewportElementBinder(nestedProtoView) {
|
||||
return new renderApi.ElementBinder({nestedProtoView: nestedProtoView});
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(ChangeDetection)
|
||||
class ChangeDetectionSpy extends SpyObject {
|
||||
constructor() { super(ChangeDetection); }
|
||||
|
@ -62,7 +62,7 @@ export function main() {
|
||||
});
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(AppView)
|
||||
class AppViewSpy extends SpyObject {
|
||||
viewContainers: AppViewContainer[] = [null];
|
||||
@ -70,7 +70,7 @@ class AppViewSpy extends SpyObject {
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(AppViewManager)
|
||||
class AppViewManagerSpy extends SpyObject {
|
||||
constructor() { super(AppViewManager); }
|
||||
|
@ -507,21 +507,21 @@ export function main() {
|
||||
});
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(Renderer)
|
||||
class SpyRenderer extends SpyObject {
|
||||
constructor() { super(Renderer); }
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(AppViewPool)
|
||||
class SpyAppViewPool extends SpyObject {
|
||||
constructor() { super(AppViewPool); }
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(AppViewListener)
|
||||
class SpyAppViewListener extends SpyObject {
|
||||
constructor() { super(AppViewListener); }
|
||||
|
@ -353,7 +353,7 @@ export function createEmbeddedPv(binders: ElementBinder[] = null) {
|
||||
class SomeComponent {
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(ProtoElementInjector)
|
||||
class SpyProtoElementInjector extends SpyObject {
|
||||
index: number;
|
||||
@ -361,21 +361,21 @@ class SpyProtoElementInjector extends SpyObject {
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(ElementInjector)
|
||||
class SpyElementInjector extends SpyObject {
|
||||
constructor(public parent: ElementInjector) { super(ElementInjector); }
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(PreBuiltObjects)
|
||||
class SpyPreBuiltObjects extends SpyObject {
|
||||
constructor() { super(PreBuiltObjects); }
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(Injector)
|
||||
class SpyInjector extends SpyObject {
|
||||
constructor() { super(Injector); }
|
||||
|
@ -79,7 +79,7 @@ class TestComponent {
|
||||
}
|
||||
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(Location)
|
||||
class DummyLocation extends SpyObject {
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
@ -92,7 +92,7 @@ function makeDummyLocation() {
|
||||
}
|
||||
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(Router)
|
||||
class DummyRouter extends SpyObject {
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
|
@ -161,7 +161,7 @@ export function main() {
|
||||
});
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(RouterOutlet)
|
||||
class DummyOutlet extends SpyObject {
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
|
@ -58,7 +58,7 @@ export function main() {
|
||||
});
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(ElementRef)
|
||||
class SpyElementRef extends SpyObject {
|
||||
nativeElement;
|
||||
@ -66,7 +66,7 @@ class SpyElementRef extends SpyObject {
|
||||
noSuchMethod(m) { return super.noSuchMethod(m) }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(DomAdapter)
|
||||
class SpyDomAdapter extends SpyObject {
|
||||
constructor() { super(DomAdapter); }
|
||||
|
@ -21,7 +21,7 @@ class TestObj {
|
||||
someComplexFunc(a) { return a; }
|
||||
}
|
||||
|
||||
@proxy
|
||||
@proxy()
|
||||
@IMPLEMENTS(TestObj)
|
||||
class SpyTestObj extends SpyObject {
|
||||
constructor() { super(TestObj); }
|
||||
|
@ -69,8 +69,8 @@ export function main() {
|
||||
var i0, i1;
|
||||
var MyClass =
|
||||
(<any>TestDecorator('test-works'))
|
||||
.Class({
|
||||
extends: Class({
|
||||
.Class(<any>{
|
||||
extends: Class(<any>{
|
||||
constructor: function() {},
|
||||
extendWorks: function() { return 'extend ' + this.arg; }
|
||||
}),
|
||||
@ -121,7 +121,7 @@ export function main() {
|
||||
});
|
||||
|
||||
it('should ensure that only Function|Arrays are supported', () => {
|
||||
expect(() => { Class({constructor: function() {}, method: 'non_function'}); })
|
||||
expect(() => { Class(<any>{constructor: function() {}, method: 'non_function'}); })
|
||||
.toThrowError(
|
||||
"Only Function or Array is supported in Class definition for key 'method' is 'non_function'");
|
||||
});
|
||||
|
Reference in New Issue
Block a user