Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c355f77

Browse files
committed
Fix propertyDecorator test
1 parent 5c3f333 commit c355f77

File tree

1 file changed

+4
-9
lines changed
  • test/fixtures/typescript/src

1 file changed

+4
-9
lines changed

‎test/fixtures/typescript/src/App.ts‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,17 @@ class App {
1111
static foo: MyObject = { bar: true, baz: { n: 123 } };
1212
n = App.foo.baz!.n;
1313
@propertyDecorator
14-
decorated;
14+
decorated=5;
1515
}
1616

1717
function annotation(target: any) {
1818
target.annotated = true;
1919
}
2020

2121
function propertyDecorator(target: any, key: string) {
22-
if (delete target[key]) {
23-
Object.defineProperty(target, key, {
24-
get() {
25-
return 42;
26-
},
27-
enumerable: true,
28-
});
29-
}
22+
arguments[2].initializer = function() {
23+
return 42;
24+
};
3025
}
3126

3227
export default App;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /