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
105: Fix old proc_macros2 dep breaking compile and fix line endings in atoms r=kdy1 a=isavegas
When trying to compile swc, I came across an issue with [proc_macro2::Span::join(&self, other: Span) -> Option\<Span\>](https://docs.rs/proc-macro2/0.4.24/proc_macro2/struct.Span.html#method.join) not existing. Easily fixed by updating the dependency from `0.4.4` to `0.4.24`.
Another major issue I came across when compiling the crate involved the `js_word!` macro throwing an error due to not accepting any parameters. After digging around, I noticed that the `js_word.rs` file that is generated by `atoms`' `build.rs` contained trailing `\r`s. As it turns out, the call to `::split(&'static str)` was allowing carriage returns to propagate to the aforementioned `js_word.rs` file. Replaced with a call to `::lines()` and a `map` to trim the words, just in case.
Co-authored-by: Leviathan Jeanis <isavegas2006@gmail.com>
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.
swc_common:
- implement VisitWith for &T and [T]
swc_ecma_ast:
- fix codegen of `===`
swc_ecma_parser:
- fix parsing of array pattern
swc_ecma_transforms:
- implement es2015::destructuring
- implement es2015::computed_properties
- implement es2015::duplicate_keys
- implement es2015::parameters
- fix `InjectHelper` pass
Note that getters / setters in class are not supported yet
- Run execution tests via jest
- ignore es2016::exponentation tests
swc_ecma_transforms:
- implement es2015::block_scoped_functions
- implement tagged template literal without escape handling
- hygiene: rename to different number
- scope: handle pattern by folding children
swc_ecma_ast:
- use Str instead of String for template literal
swc_ecma_parser:
- fix lexer tests
- handle template literal correctly
template literals now have cooked field
swc_ecma_codegen:
- escape newline character and backslash ('\')
testing:
- preserve context of the span in `::testing::DropSpan`
swc_ecma_codegen:
- disable get_text_of_node to avoid deoptimization
swc_ecma_transforms:
- allow using this inside arrow expression
- implement es2015::block_scoping with hygiene ident