Commit Graph

177 Commits

Author SHA1 Message Date
magic-akari
e5971f77d5
fix(es/ast): Fix Ident::verify_symbol () 2021-12-24 04:29:49 +00:00
magic-akari
9f5a8f728a
fix(es/compat): Fix destructuring ()
swc_ecma_transforms_compat:
 - `destructuring`: Handle assignment expressions in rhs of variable declarators correctly. (Closes )
2021-12-24 03:19:45 +00:00
Donny/강동윤
d923f89db1
fix(es/compat): Fix classes pass ()
swc_ecma_ast:
 - Add `Ident::verify_symbol`.

swc_ecma_transforms_compat:
 - Don't generate invalid identifiers. (Closes )
2021-12-24 10:46:55 +09:00
magic-akari
df87c2b302
fix(es/transforms): Fix descturcturing ()
swc_ecma_transforms_compat:
 - `destructuring`: Handle exports of bindings with object pattern properties correctly. (Closes )
2021-12-22 08:03:41 +00:00
magic-akari
ff1aab710c
fix(es/compat): Transform an optional eval call as an indirect eval call ()
swc_ecma_transforms_compat:
 - `optional_chaining`: Handle optional `eval` calls properly. (Closes )
2021-12-19 03:42:46 +00:00
OJ Kwon
a381fb8bce
fix(es/compat): Fix block_scoping ()
swc_ecma_transforms_compat:
 - `block_scoping`: Consider the location of variable declarations. (Closes )
2021-12-17 15:08:22 +09:00
Austaras
38955c0c8d
refactor(es/ast): Change type or the key of ClassProp to PropName () 2021-12-15 16:21:30 +09:00
OJ Kwon
00d22b8fde
build: Use mocha for exec_ test instead of jest () 2021-12-11 07:59:21 +00:00
Donny/강동윤
1ea965cecb
fix(es/parser): Drop outdated options ()
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 ()
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 ()
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 ()
swc_ecma_parser:
 - Preserve more data for invalid escapes in template literals.

swc_ecma_transforms_compat:
 - Fix handling of template literals. (Closes )
2021-12-02 15:49:45 +09:00
Donny/강동윤
0304c550a4
chore: Break cycles () 2021-12-02 10:44:27 +09:00
Austaras
1555ceb8a3
feat(es/transforms/compat): Add loose mode to parameters ()
swc_ecma_utils:
 - Make `WrapperState` implement `Clone`.

swc_ecma_transforms_compat:
 - `paramters`: Fix handling of non-loose mode. (Closes , Closes )
2021-12-02 01:04:01 +00:00
RiESAEX
0c1f2ebdde
fix(es/transforms/compat): Fix destructuring ()
swc_ecma_transforms_compat:
 - `desturcturing`: Fix non-loose mode. (Closes , Closes )
2021-11-30 04:49:54 +00:00
Donny/강동윤
028d0ce2c6
fix(es/transforms/compat): Fix block scoping ()
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 , Closes )
 - `block_scoping`: Don't recurse into nested loops while looking for functions. (Closes )
2021-11-30 13:11:09 +09:00
Austaras
803787ab9e
fix(es/transforms/compat): Fix arrow ()
swc_ecma_transforms_compat:
 - Handle arrow expressions in constructors of classes with a super class. (Closes )
2021-11-27 06:46:02 +00:00
RiESAEX
a6398e9f26
fix(es/transforms/compat): Fix destructuring ()
swc_ecma_transforms_compat:
 - Check length correctly. (Closes , Closes , Closes )
2021-11-25 06:51:59 +00:00
Austaras
fbcbeb4892
refactor(es/transforms/compat): Lift this replacer out of arrow ()
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 ()
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) ()
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) ()
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()
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 ()
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 .
2021-11-15 14:31:21 +09:00
Bojan Đurđević
571c5e3123
fix(es/transforms/compat): Fix new_target () 2021-11-13 20:34:28 +00:00
OJ Kwon
6148d0c3da
refactor(es/transforms/compat): Migrate to VisitMut ()
swc_ecma_transforms_compat:
 - `async_to_generator`: Migrate to `VisitMut`.
2021-11-12 07:25:32 +00:00
Donny/강동윤
2b2f6955f2
refactor: Flatten ecmascript () 2021-11-10 19:00:54 +09:00