mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Migrated decorator checks to call resolution
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// @emitdecoratormetadata: true
|
||||
// @target: es5
|
||||
|
||||
function decorator() { }
|
||||
declare var decorator: any;
|
||||
|
||||
@decorator
|
||||
class A {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @target: es6
|
||||
// @Filename: decorated.ts
|
||||
function decorate() { }
|
||||
function decorate(target: any) { }
|
||||
|
||||
@decorate
|
||||
export default class Decorated { }
|
||||
|
||||
@@ -5,7 +5,7 @@ function func(s: string): void {
|
||||
}
|
||||
|
||||
class A {
|
||||
@(x => {
|
||||
@((x, p) => {
|
||||
var a = 3;
|
||||
func(a);
|
||||
return x;
|
||||
|
||||
@@ -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) {
|
||||
// ...
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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"]() { }
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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() {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user