Commit b636306
authored
Decorators misc fixes (#14339)
* fix: ensure initializer is invoked without parameters
* fix: assert class decorators return a callable or undefined
* fix: accessor decorator returns { initialize?: (initialValue: unknown) => unknown };
* fix: assert accessor decorator returns callable get/set/initialize
* add getter/setter test cases
* add accessor-initializers ordering test
* address review comments
* remove unused param base
* add leaked context addInitializer test1 parent e597854 commit b636306
33 files changed
Lines changed: 243 additions & 61 deletions
File tree
- packages
- babel-helpers/src
- helpers
- babel-plugin-proposal-decorators/test/fixtures
- 2021-12-accessors--to-es2015
- private
- public
- static-private
- static-public
- 2021-12-getters--to-es2015
- private
- public
- static-private
- static-public
- 2021-12-getters-and-setters--to-es2015
- private
- public
- static-private
- static-public
- 2021-12-methods--to-es2015
- private-with-initializers
- public-with-initializers
- static-private-with-initializers
- static-public-with-initializers
- 2021-12-misc--to-es2015
- leaked-proto-context-addInitializer
- leaked-static-context-addInitializer
- 2021-12-ordering--to-es2015/accessor-initializers
- 2021-12-runtime-errors--to-es2015
- invalid-accessor-decorator-return
- invalid-add-initializer
- invalid-class-decorator-return
- invalid-field-decorator-return
- invalid-getter-decorator-return
- invalid-method-decorator-return
- invalid-setter-decorator-return
- 2021-12-setters--to-es2015
- private
- public
- static-private
- static-public
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
120 | 122 | | |
121 | 123 | | |
122 | 124 | | |
123 | | - | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
129 | | - | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
211 | | - | |
212 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
221 | | - | |
| 222 | + | |
222 | 223 | | |
223 | 224 | | |
224 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
225 | 235 | | |
| 236 | + | |
226 | 237 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
230 | 241 | | |
231 | | - | |
| 242 | + | |
232 | 243 | | |
| 244 | + | |
233 | 245 | | |
234 | 246 | | |
235 | 247 | | |
| |||
285 | 297 | | |
286 | 298 | | |
287 | 299 | | |
288 | | - | |
289 | 300 | | |
290 | 301 | | |
291 | 302 | | |
| |||
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
309 | | - | |
| 320 | + | |
310 | 321 | | |
311 | 322 | | |
312 | 323 | | |
| |||
329 | 340 | | |
330 | 341 | | |
331 | 342 | | |
332 | | - | |
| 343 | + | |
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
| |||
510 | 521 | | |
511 | 522 | | |
512 | 523 | | |
513 | | - | |
| 524 | + | |
514 | 525 | | |
515 | 526 | | |
516 | 527 | | |
| |||
538 | 549 | | |
539 | 550 | | |
540 | 551 | | |
541 | | - | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
542 | 557 | | |
543 | 558 | | |
544 | 559 | | |
545 | 560 | | |
546 | 561 | | |
547 | 562 | | |
548 | 563 | | |
549 | | - | |
| 564 | + | |
550 | 565 | | |
551 | 566 | | |
552 | 567 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
packages/babel-plugin-proposal-decorators/test/fixtures/2021-12-getters--to-es2015/private/exec.js
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments