the decorator does not execute in the context of the method or the constructor. at design time this and super refers to the class scope, but at run time they do not.
class Test{
private serialize(target: Function, key: string| symbol, descriptor: PropertyDescriptor) {
}
@this.serialize
public method(fileName: string, position: number): any {
}
}
generates this does which is incorrect
var Test = (function () {
function Test() {
}
Test.prototype.serialize = function (target, key, descriptor) {
};
Test.prototype.method = function (fileName, position) {
};
Object.defineProperty(Test.prototype, "method", __decorate([this.serialize], Test.prototype, "method", Object.getOwnPropertyDescriptor(Test.prototype, "method")));
return Test;
})();
the decorator does not execute in the context of the method or the constructor. at design time this and super refers to the class scope, but at run time they do not.
generates this does which is incorrect