Skip to content

Commit

Permalink
Align decorators to 2021-12 spec (#273)
Browse files Browse the repository at this point in the history
* align decorators to latest spec

* add ClassBody changes
  • Loading branch information
JLHwung committed Mar 3, 2022
1 parent dc880e6 commit e625c78
Showing 1 changed file with 31 additions and 5 deletions.
36 changes: 31 additions & 5 deletions experimental/decorators.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [Decorators](https://github.com/wycats/javascript-decorators)
# [Decorators](https://github.com/tc39/proposal-decorators)

## Decorator

Expand All @@ -9,18 +9,44 @@ interface Decorator <: Node {
}
```

## Used
## AccessorProperty
```js
interface AccessorProperty <: Node {
type: "AccessorProperty";
key: Expression | PrivateIdentifier;
value: Expression | null;
computed: boolean;
static: boolean;
decorators: [ Decorator ];
}
```

## Class
```js
extend interface MethodDefinition {
extend interface Class {
decorators: [ Decorator ];
}
```

## ClassBody

```js
extend interface ClassBody {
body: [ MethodDefinition | PropertyDefinition | StaticBlock | AccessorProperty ];
}
```

extend interface Property {
## MethodDefinition
```js
extend interface MethodDefinition {
decorators: [ Decorator ];
}
```

extend interface Class {
## PropertyDefinition

```js
extend interface PropertyDefinition {
decorators: [ Decorator ];
}
```

0 comments on commit e625c78

Please sign in to comment.