Commit 16d3220
committed
Add 2022-03 decorators version (stage 3) (#14836)
* Copy `applyDecs`->`applyDecs2203` helper, and `2021-12`->`2022-03` tests
* Avoid conflicting fn names in helpers
* Add `2022-03` decorators version
* Rename `isPrivate`/`isStatic`->`private`/`static`
* Disallow `@(...)()` in 2022-03 decorators
This commits add a new `allowCallParenthesized` option to the decorators parser plugin:
when set to `false`, `@(...)()`-style decorators are allowed to match the stage 3
proposal presented in March 2022.
It will default to `false` in Babel 8 (we might just remove the option)
* Disallow `decoratorsBeforeExport` option with 2022-03 decorators
This aligns with the Babel 8 behavior
* Remove `.initializer` fallback for accessor properties
* Remove `.initializer` fallback for accessor properties
* Expose `.access` for public class elements
* Remove `getMetadata`/`setMetadata`
* Make the parser error recoverable
* Print necessary parentheses in generator1 parent 85ce832 commit 16d3220
325 files changed
Lines changed: 7789 additions & 77 deletions
File tree
- packages
- babel-generator
- src/generators
- test/fixtures/decorators/decorator-parenthesized-expression-createParenthesizedExpression
- babel-helpers/src
- helpers
- babel-parser
- src
- parse-error
- parser
- test/fixtures/experimental/decorators
- parenthesized-allowCallParenthesized-false-invalid
- parenthesized-allowCallParenthesized-false-valid
- parenthesized-allowCallParenthesized-true
- babel-plugin-proposal-decorators
- src
- test/fixtures
- 2021-12-ordering/accessor-initializers
- 2022-03-accessors--to-es2015
- private
- public
- static-private
- static-public
- undecorated-private
- undecorated-public
- undecorated-static-private
- undecorated-static-public
- 2022-03-accessors
- private
- public
- static-private
- static-public
- undecorated-private
- undecorated-public
- undecorated-static-private
- undecorated-static-public
- 2022-03-assumption-constantSuper
- super-in-nested-constructor-expression
- super-in-private-accessor
- super-in-private-method
- 2022-03-classes--to-es2015
- expressions
- inheritance
- initializers
- replacement-static-installed-on-correct-class
- replacement-static-this
- replacement-with-expr
- replacement
- 2022-03-classes
- expressions
- inheritance
- initializers
- replacement-static-installed-on-correct-class
- replacement-static-this
- replacement-with-expr
- replacement
- 2022-03-duplicated-keys--to-es2015
- computed-keys-same-ast
- computed-keys-same-value
- method-and-field
- methods-with-same-key
- 2022-03-duplicated-keys
- computed-keys-same-ast
- computed-keys-same-value
- method-and-field
- methods-with-same-key
- 2022-03-exported
- default-anonymous
- default-named
- member-decorator
- named
- no-decorators
- 2022-03-fields--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-fields
- private
- public
- static-private
- static-public
- 2022-03-getters--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-getters-and-setters--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-getters-and-setters
- private
- public
- static-private
- static-public
- 2022-03-getters
- private
- public
- static-private
- static-public
- 2022-03-methods--to-es2015
- private-with-initializers
- private
- public-with-initializers
- public
- static-private-with-initializers
- static-private
- static-public-with-initializers
- static-public
- 2022-03-methods
- private
- public
- static-private
- static-public
- 2022-03-misc--to-es2015
- class-and-method-decorators
- class-and-property-decorators
- decorator-evaluation-scope
- initProto-existing-derived-constructor
- initializer-property-ignored
- initializer-timing
- leaked-context-addInitializer-throw
- leaked-context-addInitializer
- valid-expression-formats
- 2022-03-misc
- all-decorators
- decorator-evaluation-scope
- initProto-existing-derived-constructor-multiple-super
- initProto-existing-derived-constructor
- initializer-property-ignored
- private-keys-in-enclosing-class
- setting-private-method-via-array-pattern
- setting-private-method-via-for-of
- setting-private-method-via-object-pattern
- setting-private-method-via-rest
- setting-private-method-via-update
- setting-private-method
- super-in-nested-constructor-expression
- super-in-private-accessor
- super-in-private-method
- valid-expression-formats
- 2022-03-ordering--to-es2015
- accessor-initializers
- decorators
- field-initializers-after-methods
- initializers
- static-field-initializers-after-methods
- 2022-03-ordering
- accessor-initializers
- decorators
- field-initializers-after-methods
- initializers
- static-field-initializers-after-methods
- 2022-03-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
- 2022-03-setters--to-es2015
- private
- public
- static-private
- static-public
- 2022-03-setters
- private
- public
- static-private
- static-public
- babel-plugin-syntax-decorators
- src
- test
- babel-runtime-corejs2
- babel-runtime-corejs3
- babel-runtime
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 134 | | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
26 | 30 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
21 | | - | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
29 | | - | |
30 | | - | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
51 | | - | |
52 | | - | |
| 56 | + | |
| 57 | + | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
| |||
80 | 85 | | |
81 | 86 | | |
82 | 87 | | |
83 | | - | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
86 | 91 | | |
| |||
123 | 128 | | |
124 | 129 | | |
125 | 130 | | |
126 | | - | |
| 131 | + | |
127 | 132 | | |
128 | | - | |
129 | | - | |
| 133 | + | |
| 134 | + | |
130 | 135 | | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
134 | | - | |
| 139 | + | |
135 | 140 | | |
136 | 141 | | |
137 | 142 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
221 | | - | |
| 226 | + | |
222 | 227 | | |
223 | 228 | | |
224 | 229 | | |
| |||
231 | 236 | | |
232 | 237 | | |
233 | 238 | | |
234 | | - | |
| 239 | + | |
235 | 240 | | |
236 | 241 | | |
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
240 | 245 | | |
241 | 246 | | |
242 | | - | |
| 247 | + | |
243 | 248 | | |
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
247 | 252 | | |
248 | | - | |
| 253 | + | |
249 | 254 | | |
250 | 255 | | |
251 | 256 | | |
252 | 257 | | |
253 | 258 | | |
254 | | - | |
| 259 | + | |
255 | 260 | | |
256 | 261 | | |
257 | 262 | | |
| |||
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
264 | | - | |
| 269 | + | |
265 | 270 | | |
266 | 271 | | |
267 | | - | |
| 272 | + | |
268 | 273 | | |
269 | 274 | | |
270 | | - | |
| 275 | + | |
271 | 276 | | |
272 | 277 | | |
273 | | - | |
| 278 | + | |
274 | 279 | | |
275 | 280 | | |
276 | 281 | | |
| |||
285 | 290 | | |
286 | 291 | | |
287 | 292 | | |
288 | | - | |
| 293 | + | |
289 | 294 | | |
290 | 295 | | |
291 | 296 | | |
| |||
297 | 302 | | |
298 | 303 | | |
299 | 304 | | |
300 | | - | |
| 305 | + | |
301 | 306 | | |
302 | 307 | | |
303 | 308 | | |
| |||
351 | 356 | | |
352 | 357 | | |
353 | 358 | | |
354 | | - | |
| 359 | + | |
355 | 360 | | |
356 | 361 | | |
357 | 362 | | |
| |||
364 | 369 | | |
365 | 370 | | |
366 | 371 | | |
367 | | - | |
| 372 | + | |
368 | 373 | | |
369 | 374 | | |
370 | 375 | | |
371 | 376 | | |
372 | | - | |
| 377 | + | |
373 | 378 | | |
374 | 379 | | |
375 | 380 | | |
| |||
382 | 387 | | |
383 | 388 | | |
384 | 389 | | |
385 | | - | |
| 390 | + | |
386 | 391 | | |
387 | 392 | | |
388 | 393 | | |
| |||
395 | 400 | | |
396 | 401 | | |
397 | 402 | | |
398 | | - | |
| 403 | + | |
399 | 404 | | |
400 | 405 | | |
401 | 406 | | |
402 | 407 | | |
403 | 408 | | |
404 | | - | |
| 409 | + | |
405 | 410 | | |
406 | 411 | | |
407 | 412 | | |
| |||
485 | 490 | | |
486 | 491 | | |
487 | 492 | | |
488 | | - | |
| 493 | + | |
489 | 494 | | |
490 | 495 | | |
491 | 496 | | |
| |||
555 | 560 | | |
556 | 561 | | |
557 | 562 | | |
558 | | - | |
| 563 | + | |
559 | 564 | | |
560 | 565 | | |
561 | 566 | | |
| |||
568 | 573 | | |
569 | 574 | | |
570 | 575 | | |
571 | | - | |
572 | | - | |
| 576 | + | |
| 577 | + | |
573 | 578 | | |
574 | 579 | | |
575 | | - | |
| 580 | + | |
576 | 581 | | |
577 | 582 | | |
578 | 583 | | |
| |||
583 | 588 | | |
584 | 589 | | |
585 | 590 | | |
586 | | - | |
| 591 | + | |
587 | 592 | | |
588 | 593 | | |
589 | 594 | | |
| |||
597 | 602 | | |
598 | 603 | | |
599 | 604 | | |
600 | | - | |
| 605 | + | |
601 | 606 | | |
602 | 607 | | |
603 | 608 | | |
604 | 609 | | |
605 | | - | |
| 610 | + | |
606 | 611 | | |
607 | 612 | | |
608 | 613 | | |
| |||
615 | 620 | | |
616 | 621 | | |
617 | 622 | | |
618 | | - | |
| 623 | + | |
619 | 624 | | |
620 | 625 | | |
621 | 626 | | |
| |||
779 | 784 | | |
780 | 785 | | |
781 | 786 | | |
782 | | - | |
| 787 | + | |
783 | 788 | | |
784 | 789 | | |
785 | 790 | | |
786 | 791 | | |
787 | 792 | | |
788 | 793 | | |
789 | 794 | | |
790 | | - | |
| 795 | + | |
791 | 796 | | |
792 | | - | |
| 797 | + | |
793 | 798 | | |
794 | | - | |
| 799 | + | |
795 | 800 | | |
796 | 801 | | |
797 | 802 | | |
0 commit comments