Commit Graph

25 Commits

Author SHA1 Message Date
강동윤
252804d2e3
fix(swc): Fix bugs (#1529)
swc_ecma_parser:
 - Fix comment positions. (#1530)

swc_ecam_transforms_compat:
 - Handle default in destructuring binding patterns. (#1477, #1449)
 - `async_to_generator`: Handle `this` correctly for async function in key-value properties. (#1455)

swc_ecam_transforms_typescript:
 - Handle import defaults. (#1448)
2021-04-02 18:47:05 +09:00
강동윤
6888c69bda
Fix codegen: preserve input (#1221)
swc_ecma_codegen:
 - Preserve input. (#1204)
2020-11-21 02:04:29 +09:00
강동윤
af0b0a9ab1
Fix fixer (#1207)
swc_ecma_transforms:
 - fixer: Don't unwrap paren if there's a comment for inner node.
2020-11-08 10:59:36 +09:00
강동윤
3a26d3d34d
Do not rename keywords in meta properties (#1053) 2020-09-09 15:16:44 +09:00
강동윤
ecd7b4decc
Implement more methods for codegen (#902)
swc_ecma_codegen:
 - implement emit_private_property (Closes #903)
2020-07-27 22:58:42 +09:00
강동윤
ea885df521
Fix bugs (#901)
swc_ecma_parser:
 - Accept `export type * from '../typings'` (#896)

swc_ecma_transforms:
 - Ensure that swc does not duplicate classes (#879)
2020-07-27 20:21:52 +09:00
강동윤
283825c91a
Fix typescript_strip and handle reserved word (#802) 2020-05-28 12:00:34 +09:00
강동윤
f1900da246
Fix .swcrc (env and error message) (#784)
FIx preset-env and better error message for invalid config
2020-05-19 20:24:00 +09:00
강동윤
71ea61e6c4
Make require of regenerator use global mark (#780) 2020-05-18 23:25:41 +09:00
강동윤
ddc5ace570
dce: Separate phase for dropping imports (#764) 2020-05-09 12:22:45 +09:00
강동윤
348052b017
Improve optimizer (#660)
Although it's quite naive at the moment, I added two optimization passes.

 - dead code elimination (Closes #607)
 - inlining
2020-02-13 11:45:14 +09:00
kdy1
82e73b1121 Fix bugs (#659)
- Strip out const assertions (Closes #656)
 - Fix exclude of the file matcher (Closes #658) 
 - Automatic typescript detection (Closes #655)
2020-02-12 15:07:45 +00:00
kdy1
add63826bd Allow await expression at other than expression statement (#636)
Fixes #635
2020-02-08 01:49:00 +00:00
dsherret
55c0258017 Remove empty expression in expression statement with top level await (#630)
Eats the semi-colon.

This doesn't compile (edit: doesn't compile the code in the tests) though because the target of that folder is ES2015. Also, this is kind of strange for me to put the tests in the "typescript" folder. Should we create something more general?

You can take over this PR if you'd like!
2020-02-07 05:33:26 +00:00
kdy1
0ebda3c33e hygiene / block scoping improvement (#608)
`hygiene` pass had a bug related to globally defined variables like `Object` or `undefined`. This pr make hygiene to utilize use-bind conflict to resolve global objects correctly.
Closes #605.

block_scoping pass had a bug with closure in for statement with let or const. This pr fixes it by extracting a loop body as a variable.
Closes #604.
2020-01-24 05:54:52 +00:00
kdy1
9be9ea2c43 hygiene: fix handling of special identifiers (#603)
The identifiers are `arguments`, `undefined`, `NaN`.

Closes #602.
2020-01-23 14:23:24 +00:00
강동윤
702800e0d9
Attach comments to correct node (#541) 2019-12-28 22:02:58 +09:00
강동윤
6fa85b646f
preset-env (#537)
swc_ecma_preset_env:
 - can inject polyfills automatically
 - can apply transforms automatically

swc:
 - added env config to .swcrc
2019-12-28 11:25:54 +09:00
강동윤
b1e4122b02
Nullish coalescing / optional chaining / comments (#529)
swc_ecma_ast:
 - rename `TsOptChain` to `OptChainExpr` (Fixes #525)
 - add `BinOp::NullishCoalescing`

swc_ecma_parser:
 - parse `??` (Fixes #526)

swc_ecma_transforms:
 - remap comments from fixer (Fixes #528)
2019-12-24 17:01:32 +09:00
kdy1
0df908fdb4 ast & parser improvement (#502)
Parser can now parse typescript source code and rxjs.

Closes #468.
2019-12-11 14:28:35 +00:00
강동윤
ae6de87abb
Add more tests (#489) 2019-12-09 21:02:51 +09:00
강동윤
153cf36168
Jsonify large pure object literals (#477)
swc_ecma_transforms:
 - add `jsonify` transform
2019-12-01 17:32:44 +09:00
강동윤
a7a8a4a2e4
Plugin (#473)
swc_common:
 - apply patch from rust-lang/rust#59693

swc:
 - use &Options instead of Options
 - configures commons::CM
 - exposes `handler`
2019-11-29 23:46:06 +09:00
강동윤
747a07f566 Update submodules 2019-11-26 20:42:41 +09:00
강동윤
8c7005d7ab
More testing (#469)
swc:
 - Move tests from node-swc to swc
 - Add integration tests (webpack, rxjs, angular-core)
 - Support `exclude`
 
swc_ecma_transforms:
 - More span validation
 - classes:
    - Strip `TsIndexSignature`

swc_ecma_parser:
 - Fix span of member expression
 - Fix span of binary expression
 - Fix span of unary expression
2019-11-26 10:08:48 +09:00