Commit Graph

174 Commits

Author SHA1 Message Date
Austaras
0e2de3069d
fix(es/compat): Fix super method call in loose mode (#6207) 2022-10-20 00:20:43 +00:00
Austaras
aefc11b8a7
feat(es/compat): Support readonly and writeonly for private fields (#6182) 2022-10-18 05:38:36 +00:00
Donny/강동윤
e6b1dd4731
feat(es/testing): Add an option to test sourcemap (#6079) 2022-10-07 05:52:22 +00:00
Donny/강동윤
0c67a3adba
fix(es/compat): Fix handling of deep array pattern of object rest pass (#6035) 2022-10-04 23:34:03 +09:00
Donny/강동윤
80da0981bd
feat(es/compat): Support iterator protocol on loose mode (#6034) 2022-10-04 21:42:39 +09:00
Austaras
31ffd5a01d
fix(es/renamer): Use a separate scope for the name of FnExpr (#6008) 2022-10-01 12:33:19 +09:00
magic-akari
2b2464271a
fix(es/codegen): Remove redundant ; after export default decl (#5851) 2022-09-14 06:07:15 +00:00
Donny/강동윤
1ae539aac5
test(es/compat): Add a test for a fixed issue (#5672) 2022-08-30 11:09:58 +00:00
Donny/강동윤
4820f0cbcc
fix(es/compat): Handle yield in block scoping pass (#5668) 2022-08-30 09:55:18 +00:00
Donny/강동윤
83fec33359
feat(es/generator): Use new generator implementation (#5627) 2022-08-25 16:10:47 +00:00
Donny/강동윤
927ae7e8d3
fix(es/compat): Revert generator reimplementation (#5624) 2022-08-25 17:58:37 +09:00
Donny/강동윤
2aa009018f
feat(es/generator): Replace generator implementation with one from tsc (#5173) 2022-08-25 04:50:00 +00:00
magic-akari
86452511e7
fix(es/compat): Fix destructuring assignments and updates of super properties in async method (#5580) 2022-08-22 13:36:02 +00:00
magic-akari
bee26a9abb
fix(es/compat): Fix destructuring assignments and updates of super properties (#5576) 2022-08-22 00:42:50 +00:00
Austaras
b717a68199
fix(es/compat): Use separate SyntaxContext for class names (#5566) 2022-08-19 13:01:50 +00:00
Donny/강동윤
b9933b159a
feat(es/compat): Fix syntax context of transpiled class methods (#5498) 2022-08-16 13:07:27 +00:00
Donny/강동윤
b655bf473a
fix(es/helpers): Fix for await (#5458) 2022-08-14 05:46:07 +00:00
Austaras
5a06271116
feat(es/compat): Add pure comments for generator and async transform (#5463) 2022-08-12 13:39:26 +00:00
Austaras
b423d6f936
fix(es/compat): Fix capturing of block scoping pass (#5279) 2022-07-25 03:34:18 +00:00
Austaras
375774d31e
fix(es): Check the syntax context of arguments (#5174) 2022-07-13 10:29:03 +00:00
Austaras
cd8d65b9a7
fix(es/compat): Remove extra this/arguments capture in arrows (#5152) 2022-07-08 06:27:15 +00:00
magic-akari
dd39a798ae
fix(es/compat): Preserve more class names (#5106) 2022-07-06 05:18:40 +00:00
Austaras
adbb0bf8d8
fix(es/compat): Preserve class names (#5104) 2022-07-04 14:37:03 +00:00
Austaras
18ea2b5770
fix(es/compat): Preserve this in function with block scoped vars (#5056) 2022-06-29 04:03:00 +00:00
Austaras
25bd520620
fix(es/compat): Handle classes with accessors and a method with the same name (#5039) 2022-06-28 05:36:22 +00:00
magic-akari
04fc1cb429
fix(es/compat): Fix name conflict of Array (#5034) 2022-06-25 04:55:59 +00:00
Donny/강동윤
36d960c7e9
perf(es/hygiene): Make hygiene faster (#4952) 2022-06-15 14:36:57 +00:00
Donny/강동윤
dc911dcae6
feat(es/compat): Don't create vars for computed class methods if possible (#4805) 2022-05-27 05:12:57 +00:00
Austaras
573bcb5b49
fix(es/compat): Use define for non-spread props (#4754) 2022-05-26 20:32:41 +09:00
Austaras
db1698e012
fix(es/compat): Handle nested break/continue in block_scoping (#4778) 2022-05-24 12:31:50 +00:00
Austaras
4f00914c1a
fix(es/compat): Handle nested for loops with break/continue (#4777) 2022-05-24 11:32:49 +00:00
magic-akari
100c0b58c9
fix(es/compat): Fix break in for await loop (#4705) 2022-05-18 22:06:48 +00:00
Austaras
2e74787870
fix(es/compat): Memorize computed props in logical assignment (#4525) 2022-05-05 02:25:37 +00:00
Donny/강동윤
a6d404a8c2
chore(repo): Configure prettier (#4523) 2022-05-04 14:25:28 +00:00
Austaras
9e45882b84
fix(es/compat): Fix the position of inserted statements in class_properties (#4511) 2022-05-04 12:13:38 +09:00
Austaras
c4b156ce1f
fix(es/compat): Visit default export in static_block (#4500) 2022-05-03 02:20:49 +00:00
magic-akari
1e1d081805
fix(es/compat): Support updating a private field with bigint value (#4136) 2022-05-02 13:34:46 +09:00
Donny/강동윤
0bc0bae90d
fix(es/async-generator): Fix yield* in async generators (#4452) 2022-04-28 04:14:17 +00:00
Donny/강동윤
53610fdafc
feat(es/resolver): Use different syntax context for unresolved refs (#4436)
- We don't need a list of bindings to check if an identifier is unresolved.
 - Checking if an identifier is unresolved is now one CPU instruction.
   - Previously it was one hashmap operation.
 - This PR also improves performance, by removing the hashmaps mentioned above.
2022-04-26 07:38:50 +00:00
Donny/강동윤
7599fe7431
fix(es/parser): Enable static blocks by default (#4334) 2022-04-15 07:31:41 +00:00
Donny/강동윤
6c9882ec68 fix(es/compat): Fix renaming bug of block_scoping (#4310) 2022-04-12 22:11:34 +09:00
那里好脏不可以
37a8c90750
chore(*): Typo + fomatting (#4304) 2022-04-11 18:45:58 +00:00
magic-akari
6a27a0ce88
fix(es/compat): Hoist env in function params (#4210) 2022-03-31 13:00:19 +00:00
Austaras
c946236fcc
fix(es/compat): Fix label handling of block_scoping (#4198) 2022-03-30 21:16:34 +00:00
Austaras
3426dda4f7
fix(es/compat): Handle new.target in getter/setter properties (#4194) 2022-03-30 12:04:27 +00:00
magic-akari
4f5c5cf842
fix(es/compat): Handle spreads of string literials (#4191) 2022-03-30 19:30:06 +09:00
Alexander Akait
634d732803
feat(es/ast): Add raw to Str (#4071) 2022-03-22 07:54:08 +00:00
Austaras
f5b9600b2b
fix(es/compat): Visit non-method properties in a nested object literal (#4094) 2022-03-19 14:11:54 +00:00
Donny/강동윤
0d6bd813b2
fix(es/compat): Revert wrong fix of arrow (#4093) 2022-03-19 11:25:52 +00:00
Donny/강동윤
cb0881cc3d
fix(es/compat): Visit generated codes from arrow (#4090) 2022-03-19 10:26:58 +00:00
Donny/강동윤
e19a60aad4
fix(es/compat): Change pass ordering of es2015 (#4029)
**Description:**

We should apply `regenerator` after `block_scoping` because `regenerator` does not know how to handle `const`s.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/3006
2022-03-15 14:17:03 +00:00
Austaras
de8a7116cd
fix(es/compat): Refer this in constructor when super_is_callable_constructor is set (#3944) 2022-03-10 13:52:54 +00:00
Austaras
112f428734
feat(es/compat): Add pure comments for class fields keys (#3939) 2022-03-10 07:13:58 +00:00
Donny/강동윤
3d43a9b69d
feat(es/testing): Print comments in test_fixture (#3920) 2022-03-09 02:54:27 +00:00
Austaras
9dd0105c5b
feat(es/fixer): Remove extra parens around iife in expression position (#3887) 2022-03-07 03:51:57 +00:00
magic-akari
c7f2bdb813
feat(es/compat): Implement loose mode for async_to_generator (#3870) 2022-03-05 19:32:59 +00:00
Austaras
6f076e4927
feat(es/transform): Unify logic for handling class properties (#3766) 2022-03-05 06:46:09 +00:00
Donny/강동윤
406b8eaeaf
fix(es/compat): Fix block scoping of variables (#3826) 2022-03-03 10:51:45 +00:00
Donny/강동윤
814dcc09d6
test(es/compat): Organize tests (#3825) 2022-03-03 05:51:09 +00:00
Austaras
5b6beca1af
feat(es/compat): Use sequence expressions instead of iife in classes pass (#3773) 2022-03-01 16:10:57 +09:00
Austaras
11bf29f44b
fix(es/compat): Initialize class fields as a last step (#3767) 2022-02-27 16:17:14 +00:00
magic-akari
8ed4d2fcac
feat(es/compat): Optimize handling of literals in computed property names (#3756) 2022-02-27 18:38:26 +09:00
Austaras
14155eb0e7
feat(es/compat): Implement loose mode for class_properties (#3722) 2022-02-27 00:09:02 +09:00
Austaras
05de029cfa
fix(es/compat): Fix handling of private getters and setters (#3695) 2022-02-25 06:08:35 +00:00
Austaras
b6434e52e7
fix(es/compat): Throw an error if a private property is initialized multiple times (#3665) 2022-02-23 07:03:13 +00:00
Austaras
2cb66ae075
refactor(es/ast): Change definition of optional chaining expressions (#3645) 2022-02-21 07:12:09 +00:00
Austaras
31917417e9
fix(es/compat): Handle super and new.target in class properties (#3594) 2022-02-16 15:29:20 +00:00
Austaras
f67796a962
fix(es/utils): Keep arguments to super call (#3570) 2022-02-15 15:42:40 +09:00
Austaras
0f7a99787f
feat(es/compat): Add loose mode for classes (#3474) 2022-02-15 04:02:08 +00:00
Austaras
0b162102fa fix(es/compat): Fix handling of constructor in classes (#3505)
swc_ecma_transforms_compat:
 - Use `SuperFieldAccessFolder` for `super` fields in constructors.
 - Fix handling of variables in constructors with the same name as the class name.
 - Fix handling of functions in constructors with this/super.
2022-02-14 18:14:55 +09:00
Austaras
45b44b088c
fix(es/compat): Handle arrow parameters in class fields (#3556) 2022-02-14 15:44:33 +09:00
magic-akari
342c320bfa
fix(es/compat): Fix destructing of const (#3545) 2022-02-13 04:34:06 +09:00
magic-akari
5802b62e34
fix(es/compat): Allow destructuring assignment to an object property (#3544) 2022-02-12 21:43:51 +09:00
Donny/강동윤
9b76783281
refactor(common): Cleanup & rustfmt (#3495)
swc_common:
 - Merge identical source codes.

swc_css_parser:
 - Deny `clippy::all`.
 - Fix lints.
2022-02-09 06:33:32 +00:00
Donny/강동윤
8bf5cf4d03
chore(es): Fix clippy warnings (#3482) 2022-02-08 19:50:22 +09:00
magic-akari
3bb2a6ccca
fix(es/compat): Handle initializer hole in array patterns (#3442) 2022-02-04 12:33:19 +09:00
Austaras
01500a54e0
fix(es/compat): Handle private fields in nested classes (#3431) 2022-02-03 08:54:30 +00:00
Donny/강동윤
b1a8db6194
fix(es/block-scoping): Pop scope correctly on early returns (#3360)
swc_ecma_transforms_compat:
 - `block_scoping`: Pop scope even on fast-path.
2022-01-25 17:22:58 +09:00
Austaras
29aaac1f15
fix(es/compat): Handle nested functions in private_field (#3355) 2022-01-24 20:55:43 +00:00
magic-akari
6d1ad368ac
fix(es/compat): Fix regression of destructuring (#3326) 2022-01-20 14:46:58 +00:00
Austaras
90a62bb215
refactor(es/utils): Merge the super field visitor with FnEnvHoister (#3279) 2022-01-17 13:35:32 +09:00
RiESAEX
d3cc488ac1
feat(es/compat): Use var for _len and args in rest parameters (#3267) 2022-01-14 14:13:42 +00:00
Donny/강동윤
7c19e26d0f
fix(es/transforms): Fix this in async arrow class properties (#3252)
swc_ecma_transforms_compat:
 - `async_to_generator`: Fix `this` in async class properties. (https://github.com/vercel/next.js/issues/33283)
 - Add a test for #3228 (Closes #3228).
2022-01-14 12:44:34 +09:00
Donny/강동윤
978de5943e
chore(ci): Configure clippy (#3250) 2022-01-13 23:06:11 +09:00
magic-akari
2e5150d2b7
fix(es/compat): Transform &&= operator (#3225) 2022-01-11 10:33:57 +00:00
RiESAEX
b649d23bac
feat(es/compat): Implement object super (#3127)
swc_ecma_transforms_compat:
 - Implement object super. (Closes #2684)
2022-01-11 07:45:01 +00:00
Austaras
f58b50bea7
refactor(es/ast): Change types of member-like expressions (#3178)
swc_ecma_ast:
 - Split `MemberExpr` into `MemberExpr` and `SuperPropExpr`.
 - Use `Box<Expr>` for `MemberExpr.obj`.
 - Use ad-hoc type for `MemberExpr.prop`.
 - Use ad-hoc type for `SuperPropExpr.prop`.
 - Use `Callee` instead of  `ExprOrSpread` for `CallExpr`.
 - Simplify types for meta property expressions.
2022-01-10 13:54:42 +00:00
magic-akari
5bee4e4902
refactor(es/compat): Preserve length of functions in async_generator (#3202) 2022-01-08 15:19:41 +00:00
magic-akari
52961804d1
feat(es/codegen): Make the output for empty objects and empty statements pretty (#3171) 2022-01-03 05:54:58 +09:00
magic-akari
e11210309c
fix(es/compat): Fix new.target in class properties (#3156) 2021-12-31 04:01:28 +09:00
magic-akari
f78d005a95
fix(es/compat): Fix length of async functions (#3136)
swc_ecma_transforms_compat:
 - `async_to_generator`: Preserve function length. (Closes #3135)
2021-12-30 10:26:26 +00:00
magic-akari
35b64613bb
fix(es/compat): Visit all private class methods (#3150) 2021-12-30 17:21:54 +09:00
Austaras
356082ad84
fix(es/utils): Fix handling of new.target (#3145) 2021-12-29 11:38:32 +00:00
magic-akari
27d3fd93b0
fix(es/compat): Fix computed_properties (#3120)
swc_ecma_transforms_compat:
 - `computed_properties`: Fix handling of getter/setter properties. (Closes #2680)
2021-12-28 08:07:30 +00:00
magic-akari
1b6ac25d5c
fix(es/compat): Fix private methods of a class (#3123)
swc_ecma_transforms_compat:
 - `class_properties`: Handle private method calls properly. (Closes #3055)
2021-12-26 19:37:46 +00:00
magic-akari
ac78a527eb
fix(es/compat): Fix handling of hoisted functions in regenerator (#3119)
swc_ecma_ast:
 - Implement `Take` for `FnDecl`.

swc_ecma_transforms_compat:
 - `regenerator`: Handle hoisted function declarations properly. (Closes #2556)
 - `regenerator`: Fix handling of class properties with an async function as the initializer. (Closes #2620)
2021-12-26 14:36:21 +00:00
magic-akari
a1cb4a4aa5
fix(es/compat): Fix handling of class methods with a big int as a key (#3118) 2021-12-25 14:46:56 +00:00
magic-akari
e5971f77d5
fix(es/ast): Fix Ident::verify_symbol (#3108) 2021-12-24 04:29:49 +00:00
magic-akari
9f5a8f728a
fix(es/compat): Fix destructuring (#3104)
swc_ecma_transforms_compat:
 - `destructuring`: Handle assignment expressions in rhs of variable declarators correctly. (Closes #2850)
2021-12-24 03:19:45 +00:00
Donny/강동윤
d923f89db1
fix(es/compat): Fix classes pass (#3107)
swc_ecma_ast:
 - Add `Ident::verify_symbol`.

swc_ecma_transforms_compat:
 - Don't generate invalid identifiers. (Closes #3106)
2021-12-24 10:46:55 +09:00