Migrated decorator checks to call resolution

This commit is contained in:
Ron Buckton
2015-05-21 16:45:23 -07:00
parent db6928e1ce
commit ac447f1f51
51 changed files with 533 additions and 306 deletions

View File

@@ -2,7 +2,7 @@
// @emitdecoratormetadata: true
// @target: es5
function decorator() { }
declare var decorator: any;
@decorator
class A {

View File

@@ -4,8 +4,8 @@ declare function ClassDecorator1(target: Function): void;
declare function ClassDecorator2(x: number): (target: Function) => void;
declare function PropertyDecorator1(target: Object, key: string | symbol, descriptor?: PropertyDescriptor): void;
declare function PropertyDecorator2(x: number): (target: Object, key: string | symbol, descriptor?: PropertyDescriptor) => void;
declare function ParameterDecorator1(target: Function, key: string | symbol, paramIndex: number): void;
declare function ParameterDecorator2(x: number): (target: Function, key: string | symbol, paramIndex: number) => void;
declare function ParameterDecorator1(target: Object, key: string | symbol, paramIndex: number): void;
declare function ParameterDecorator2(x: number): (target: Object, key: string | symbol, paramIndex: number) => void;
@ClassDecorator1
@ClassDecorator2(10)

View File

@@ -1,6 +1,6 @@
// @target: es6
// @Filename: decorated.ts
function decorate() { }
function decorate(target: any) { }
@decorate
export default class Decorated { }

View File

@@ -5,7 +5,7 @@ function func(s: string): void {
}
class A {
@(x => {
@((x, p) => {
var a = 3;
func(a);
return x;

View File

@@ -9,7 +9,7 @@ export var test = 'abc';
import { test } from './a';
function filter(handler: any) {
return function (target: any) {
return function (target: any, propertyKey: string) {
// ...
};
}

View File

@@ -1,5 +1,5 @@
// @target: ES6
declare function dec(): <T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
declare function dec<T>(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T>;
class C {
@dec ["1"]() { }

View File

@@ -1,5 +1,5 @@
// @target:es5
declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void;
declare function dec(target: Object, propertyKey: string | symbol, parameterIndex: number): void;
class C {
method(@dec p: number) {}

View File

@@ -1,4 +1,4 @@
// @target: ES5
// @target: ES5
// @noLib: true
// @Filename: a.ts
@@ -11,11 +11,12 @@ interface Function { }
interface RegExp { }
interface IArguments { }
// @Filename: b.ts
// @Filename: b.ts
/// <reference path="a.ts" />
declare var dec: any;
declare function dec(t, k, d);
@dec
class C {
@dec
method() {}
}