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
swc_atoms:
- add some atoms
swc_ecma_ast:
- ast nodes for typescript
- `ClassMethod` -> `Method`, `ClassMethodKind` -> `MethodKind`
- private class method / class property
- use separate type for tagged template literals
- add `declare` field to `Decl`s
- make function body optional
swc_ecma_parser:
- rename Type to TokenContext
- support decorators
Note: error reporting for invalid decorator is not implemented yet
- merge `Config` into `Syntax`
- Use DiagnosticBuilder for error type
This is to make backtracking cheaper.
swc_ecma_transforms:
- add `strip` pass
swc_ecma_parser:
- improve parser's tests
It now shows the code failed to parse
- allow rest pattern in catch clause
- fix parsing of named export (semicolon)
swc_ecma_transforms:
- implement array spread
- add helper methods (objectWithoutProperties)
- add some fast paths
- make es2015::parameters handle catch clauses
- don't show helpers when execution failed
- export fixer
swc_common:
- update rustc-ap crates to v313
swc_ecma_ast:
- use bool instead of Option<Span>
swc_ecma_parser:
- remove LexerInput
- use uncons_while
- assert only on debug mode
- use Visit instead of Fold while verifying
- replace debug! with trace!
- disable logging while benchmarking
- drop slog
swc_ecma_transforms:
- classes: fold Decl instead of Stmt
swc:
- add nodejs binding
`Map<T>` adds a method named `map` which is actually `Box<T>` -> `Box<T>` without reallocation.
swc_ecma_transforms:
- chain_at!(Type, passes)
This macro deeply joins path at 'Type' level.