Commit Graph

94 Commits

Author SHA1 Message Date
강동윤
34fff56462 Add a test for #211.
Closes #211.
2019-02-14 21:17:01 +09:00
강동윤
9bd7a9c484
Perfect fixer (#212)
swc_ecma_transforms:
 - test fixer using test262
 - make fixer perfect
2019-02-14 21:12:05 +09:00
강동윤
b76c4f26e6 Fix #210. 2019-02-14 17:46:22 +09:00
강동윤
e20998d69b FIx #209 2019-02-14 16:06:54 +09:00
강동윤
631eff9e8c
Bugfixes (#208)
swc_ecma_codegen:
 - fix codegen of shebang (#177)
 - add test for #197.

swc_ecma_transforms:
 - fix object rest spread pass (#162)
2019-02-14 13:24:01 +09:00
강동윤
b27829825e
Fix Bugs (#205)
swc_ecma_codegen:
 - escape characters (#204)

swc_ecma_parser:
 - fix parsing of `<!--`

swc_ecma_transforms:
 - promote VarCollector to crate-level utility
 - fix es3::member_expr_lits (#206)
 - fix es2015::duplicate_keys pass (#203)
 - improve fixer (paren for assignment) (#201)
 - improve fixer (arrow expression) (#207)
 - make typescript pass strip out type-only exports (#196)
2019-02-14 11:03:06 +09:00
강동윤
c1a3cc53c1
React jsx / improve fixer (#202)
swc_ecma_parser:
 - fix parsing of jsx

swc_ecma_transforms:
 - fix fixer (#199)
2019-02-13 19:12:00 +09:00
강동윤
c647cf1bc0
Fix bugs (#193)
swc_ecma_parser:
 - fix lexer
 - better error reporting for jsx reference test

swc_ecma_codegen:
 - Update references
2019-02-13 16:03:38 +09:00
강동윤
a13e6a09b5
Fix #185 (#187)
swc_ecma_transforms:
 - handle imports correctly (in rhs of assignment)
2019-02-13 12:32:12 +09:00
강동윤
74858c3b66
Fix #167 (#186) 2019-02-13 11:56:45 +09:00
강동윤
bf128d295f Add test for #182.
Closes #182.
2019-02-13 11:33:28 +09:00
강동윤
2d062432a8
Shebang & small improvement for object rest spread (#184)
swc_ecma_ast:
 - handle shebang

swc_ecma_codegen:
 - handle shebang

swc_ecma_parser:
 - handle shebang

swc_ecma_transforms:
 - fix arrow expression used with object rest spread
2019-02-13 11:08:21 +09:00
강동윤
f797019b79
Use strict (#183)
swc_ecma_parser:
- fix parsing of use strict without semicolon.

swc_ecma_transforms:
 - emit helpers after use strict.
2019-02-13 08:44:54 +09:00
강동윤
fc661f24f0
Bugfixes (#182)
swc_ecma_ast:
 - rename ast to be consistent
2019-02-13 08:18:19 +09:00
강동윤
cc36bbe3ad Add tests for #169. 2019-02-12 22:18:14 +09:00
강동윤
227423d5f6
Export default from & fix codegen of imports (#168)
swc_ecma_ast:
 - Support `export v from 'foo';`

swc_ecma_parser:
 - Support `export v from 'foo';`

swc_ecma_codegen:
 - Fix codegen of side-effect imports
2019-02-12 15:30:11 +09:00
강동윤
45e78e40d4
Amd & Correct named exports (#165) 2019-02-12 11:41:08 +09:00
강동윤
a0c6b4458e
Revert "Amd & Fix for exports (#164)" (#166)
This reverts commit 8c5c7b55b7.
2019-02-12 11:40:36 +09:00
강동윤
8c5c7b55b7
Amd & Fix for exports (#164)
swc_ecma_transforms:
 - correctly tracks exported names.
 - Implement amd

Fix #162
2019-02-12 11:23:19 +09:00
Nate Mara
42f94a3f24 Remove HERE eprintln (#161) 2019-02-12 06:24:12 +09:00
강동윤
d98219cd42 Reduce vtable size of Pass. 2019-02-11 19:11:14 +09:00
강동윤
7fe2245a3d
Cleanup (#152)
- replace Lrc with std::sync::Arc
swc_common:
 - make swc_common::sync private
 - improve MoveMap

swc_ecma_codegen:
 - fix codegen of import.

swc_ecma_transforms:
 - properly detect valid identifier.

swc_ecma_parser:
 - Fix parsing of cond expr inside paren.
2019-02-11 11:39:20 +09:00
강동윤
ab4f619257
Fix tests (#142) 2019-02-10 20:49:29 +09:00
강동윤
3b8d36dc58 Parse dynamic imports 2019-02-10 12:07:40 +09:00
강동윤
654f55b658 Closes #137, Closes #138 2019-02-09 12:19:20 +09:00
강동윤
7482836d5e Support typescript constructor parameter property 2019-02-08 18:13:32 +09:00
강동윤
43d633b44d
Handle comments and improve codegen (#136)
swc_ecma_codegen:
 - Improve codegen
 - Handle comments

swc_ecma_parser:
 - Handle comments
2019-02-08 13:00:58 +09:00
강동윤
cc83b863ec Threading support 2019-02-06 12:09:42 +09:00
강동윤
17ed32a73c Fix common_js::lazy 2019-02-05 15:47:17 +09:00
강동윤
c5e18e06d1 Use objekt::Clone 2019-02-05 15:24:30 +09:00
강동윤
ea013a1e12 Export module configs 2019-02-05 14:33:29 +09:00
강동윤
4c6c4bc595
Make Helper scoped thread local (#134)
This allows injecting helpers per file without any multi threading issue.
2019-02-05 14:15:38 +09:00
강동윤
a1629d3997
Implement module transforms (#133)
swc_ecma_ast:
 - implement more `From<T>` for `Expr`

swc_ecma_transforms:
 - fnv -> fxhash
 - implement common js imports
 - improve fixer
 - use js_word! instead of &*sym
 - add noop pass
 - handle state correctly
 - ExprFactory::member(), computed_member()
2019-02-05 12:50:19 +09:00
강동윤
33fe3a9515 Remove dbg! 2019-02-02 23:17:06 +09:00
강동윤
ca6f4eb096 Remove unnecessary logging 2019-01-31 19:49:02 +09:00
강동윤
d8d117b494 implement Clone for HelperResetter 2019-01-31 19:44:34 +09:00
강동윤
976943ba97
Add HelperResetter pass (#132) 2019-01-31 19:39:26 +09:00
강동윤
f914c8579e
Revert "Fix Arc<Helpers> (#130)" (#131)
This reverts commit 6865370205.
2019-01-31 18:22:35 +09:00
강동윤
6865370205
Fix Arc<Helpers> (#130)
Don't clone Arc<Helpers>
2019-01-31 15:14:49 +09:00
강동윤
e681ae37e4 mute resolver 2019-01-30 13:09:21 +09:00
강동윤
e63be11d0e Fix order of the classes pass 2019-01-30 13:05:45 +09:00
강동윤
c87fac213a Add a test about inheriting native class 2019-01-30 11:30:09 +09:00
강동윤
ba0c7c908c
Improve swc_ecma_trnasforms (#127)
# swc_ecma_ast
 - Add PrivateName to Expr

# swc_ecma_parser
 - Fix parsing of private name

# swc_ecma_transforms

## Hygiene
 - It correctly tracks `BindingIdentifer` / `IdentifierReference`
 - Preserve `IdentiferReference` if it conflicts with a `BindingIdentifier`

## Block scoping
 - It correctly tracks `BindingIdentifer` / `IdentifierReference`


## Fixer
 - It removes useless parens.
 - It removes useless `IdentiferReference`s in comma expressions.

## Classes properties
 - public prooperty
 - private property

## Class decorators
 - implemented
2019-01-29 23:56:16 +09:00
강동윤
90135ede1e fix a bug 2019-01-24 16:41:19 +09:00
강동윤
c648232864
Classes improvements (#123)
Now swc passes all tests from `@babel/plugin-transform-classes`
2019-01-24 16:07:09 +09:00
강동윤
eebf14fbef
Allow stable rust (#118)
This pr introduces some cargo features. For `swc_common` and `swc_ecma_ast`, it introduces a feature flag `fold`.
`Fold` and `Visit` traits exist only if the feature is enabled.

For `swc_ecma_parser`, flag called `verify` is added. When disabled, we skip checking of validity of some expressions.

e.g. `{foo = bar}`

Verification is disabled by default it requires nightly compiler
2019-01-17 23:17:16 +09:00
강동윤
bb28d81ed4 Strip typescript declarations 2019-01-15 20:51:13 +09:00
강동윤
a126afaf42 Better error messages for unimplemented!s 2019-01-15 20:18:41 +09:00
강동윤
b9eb110549 Cache compiled helpers 2019-01-15 11:53:43 +09:00
강동윤
e85bcce9cf implement Clone for passes 2019-01-15 11:15:18 +09:00