magic-akari
df87c2b302
fix(es/transforms): Fix descturcturing
( #3098 )
...
swc_ecma_transforms_compat:
- `destructuring`: Handle exports of bindings with object pattern properties correctly. (Closes #2858 )
2021-12-22 08:03:41 +00:00
magic-akari
ff1aab710c
fix(es/compat): Transform an optional eval call as an indirect eval call ( #3068 )
...
swc_ecma_transforms_compat:
- `optional_chaining`: Handle optional `eval` calls properly. (Closes #2735 )
2021-12-19 03:42:46 +00:00
OJ Kwon
a381fb8bce
fix(es/compat): Fix block_scoping
( #3058 )
...
swc_ecma_transforms_compat:
- `block_scoping`: Consider the location of variable declarations. (Closes #2998 )
2021-12-17 15:08:22 +09:00
Austaras
38955c0c8d
refactor(es/ast): Change type or the key
of ClassProp
to PropName
( #3038 )
2021-12-15 16:21:30 +09:00
OJ Kwon
00d22b8fde
build: Use mocha
for exec_ test
instead of jest
( #3009 )
2021-12-11 07:59:21 +00:00
Donny/강동윤
1ea965cecb
fix(es/parser): Drop outdated options ( #2974 )
...
swc_ecma_parser:
- Drop flags in `EsConfig`.
- Drop flags in `TsConfig`.
- Drop unused variants from `SyntaxError`.
2021-12-05 17:33:34 +09:00
David Sherret
beb2c73c2c
fix(swc/hygiene): Prefer not renaming top level variables ( #2940 )
...
swc_ecma_transforms_base:
- `hygiene`: Use concept of depth to prevent renaming top level nodes.
2021-12-04 01:55:27 +09:00
David Sherret
4d993c26b6
fix(es/hygiene): Reduce renaming ( #2938 )
...
swc_ecma_transforms_base:
- `hygiene`: Treat class methods and constructors as a scope.
2021-12-02 07:28:09 +00:00
RiESAEX
d8c8641e59
fix(es/parser, es/compat): transform tagged template with invalid escape sequence ( #2939 )
...
swc_ecma_parser:
- Preserve more data for invalid escapes in template literals.
swc_ecma_transforms_compat:
- Fix handling of template literals. (Closes #2674 )
2021-12-02 15:49:45 +09:00
Donny/강동윤
0304c550a4
chore: Break cycles ( #2941 )
2021-12-02 10:44:27 +09:00
Austaras
1555ceb8a3
feat(es/transforms/compat): Add loose mode to parameters
( #2911 )
...
swc_ecma_utils:
- Make `WrapperState` implement `Clone`.
swc_ecma_transforms_compat:
- `paramters`: Fix handling of non-loose mode. (Closes #2800 , Closes #2825 )
2021-12-02 01:04:01 +00:00
RiESAEX
0c1f2ebdde
fix(es/transforms/compat): Fix destructuring
( #2904 )
...
swc_ecma_transforms_compat:
- `desturcturing`: Fix non-loose mode. (Closes #2841 , Closes #2863 )
2021-11-30 04:49:54 +00:00
Donny/강동윤
028d0ce2c6
fix(es/transforms/compat): Fix block scoping ( #2916 )
...
swc_ecma_transforms_compat:
- `block_scoping`: Track if we are in nested loops.
- `block_scoping`: Don't treat `break` nor `continue` in nested loops as leaper. (https://github.com/vercel/next.js/issues/31757 , Closes #2799 , Closes #2915 )
- `block_scoping`: Don't recurse into nested loops while looking for functions. (Closes #2622 )
2021-11-30 13:11:09 +09:00
Austaras
803787ab9e
fix(es/transforms/compat): Fix arrow
( #2882 )
...
swc_ecma_transforms_compat:
- Handle arrow expressions in constructors of classes with a super class. (Closes #2811 )
2021-11-27 06:46:02 +00:00
RiESAEX
a6398e9f26
fix(es/transforms/compat): Fix destructuring
( #2866 )
...
swc_ecma_transforms_compat:
- Check length correctly. (Closes #2819 , Closes #2821 , Closes #2843 )
2021-11-25 06:51:59 +00:00
Austaras
fbcbeb4892
refactor(es/transforms/compat): Lift this replacer out of arrow ( #2812 )
...
swc_ecma_utils:
- Add `FunctionWrapper`, which tracks `this` and `arguments`.
swc_ecma_transforms_compat:
- `arrow`: Use `FunctionWrapper` instead of tracking `this` by itself.
- `async_to_generator`: Use `FunctionWrapper` instead of tracking `this` by itself.
2021-11-24 00:59:06 +00:00
Donny/강동윤
6a7775b5da
fix(es/transforms/compat): Fix this
in constructor ( #2818 )
...
swc_ecma_transforms_classes:
- Don't modify `this` in constructors.
swc_ecma_transforms_compat:
- Fix handling of `this` in constructors.
2021-11-20 19:07:42 +09:00
OJ Kwon
26734d44eb
fix(es/transforms/compat): Reduce .bind(this)
( #2806 )
...
swc_ecma_transforms_compat:
- `async_to_generator`: Reduce explicit `.bind(this)`.
2021-11-20 08:04:27 +00:00
OJ Kwon
5261df52d2
fix(es/transforms/compat): Remove .bind(this)
( #2776 )
...
swc_ecma_transforms_compat:
- `async_to_generator`: Create `_this` instead of using `.bind(this)`.
2021-11-18 14:39:12 +00:00
Austaras
29da148b3e
fix(es/transforms/compat): Fix optional_chaining
( #2791 )
...
swc_ecma_transforms_compat:
- `optional_chaining`: Preserve arguments of a call in an optional chaining expression.
2021-11-18 08:00:46 +00:00
Austaras
dc58122283
feat(es/transforms/compat): Add more loose mode ( #2611 )
...
swc_ecma_transforms_compat:
- `computed_properties`: Add loose mode.
- `template_literals`: Add loose mode.
- `object_spread`: Add loose mode.
- `optional_chaining`: Add loose mode.
- `nullish_coalescing`: Add loose mode.
- `optional_chaining`: Fix #2734 .
2021-11-15 14:31:21 +09:00
Bojan Đurđević
571c5e3123
fix(es/transforms/compat): Fix new_target
( #2736 )
2021-11-13 20:34:28 +00:00
OJ Kwon
6148d0c3da
refactor(es/transforms/compat): Migrate to VisitMut
( #2709 )
...
swc_ecma_transforms_compat:
- `async_to_generator`: Migrate to `VisitMut`.
2021-11-12 07:25:32 +00:00
Donny/강동윤
2b2f6955f2
refactor: Flatten ecmascript
( #2708 )
2021-11-10 19:00:54 +09:00