Commit Graph

9 Commits

Author SHA1 Message Date
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