Create decorator.ts
This commit is contained in:
24
pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/typescript/cpd/testdata/decorator.ts
vendored
Normal file
24
pmd-javascript/src/test/resources/net/sourceforge/pmd/lang/typescript/cpd/testdata/decorator.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
class Point {
|
||||
private _x: number;
|
||||
private _y: number;
|
||||
constructor(x: number, y: number) {
|
||||
this._x = x;
|
||||
this._y = y;
|
||||
}
|
||||
|
||||
@configurable(false)
|
||||
get x() {
|
||||
return this._x;
|
||||
}
|
||||
|
||||
@configurable(false)
|
||||
get y() {
|
||||
return this._y;
|
||||
}
|
||||
}
|
||||
|
||||
function configurable(value: boolean) {
|
||||
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
|
||||
descriptor.configurable = value;
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user