Repository navigation
Commit 29a3382
fix: uneval emits valid JS for repeated empty Map/Set (#168)
* fix: uneval emits valid JS for repeated empty Map/Set
A Map or Set referenced more than once is bound to a variable and populated via
a chained statement (e.g. a.set(...).set(...)). When the collection was empty,
this produced a dangling member expression 'a.' \u2014 a syntax error. Emit no
chained statement for empty collections; 'new Map'/'new Set' already builds them.
* refactor: address review feedback on Map/Set chain building1 parent 48cc81f commit 29a3382
3 files changed
Lines changed: 38 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | | - | |
| 416 | + | |
417 | 417 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
423 | 422 | | |
| 423 | + | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
| 427 | + | |
| 428 | + | |
431 | 429 | | |
| 430 | + | |
432 | 431 | | |
| 432 | + | |
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
633 | 655 | | |
634 | 656 | | |
635 | 657 | | |
| |||
0 commit comments