Commit Graph

455 Commits

Author SHA1 Message Date
Sosuke Suzuki
ecd617af39
feat(es/transforms): Move class_properties to es2022 () 2021-10-23 23:25:14 +09:00
Donny/강동윤
9e215769cc
fix(es/minifier): Fix minifier using Deno test suite ()
swc_ecma_codegen:
 - Emit `;` after private class properties.

swc_ecma_minifier:
 - `pure`: Drop more invalid expressions.
 - `sequences`: Drop more invalid expressions.
 - `strings`: Fix concat.
 - `inline`: Inline into `b` in `a[b] = foo`.
2021-10-21 11:56:48 +00:00
Donny/강동윤
eef3d6e3fb
fix(es): Fix simple bugs ()
swc_ecma_parser:
 - Don't panic on `declare declare`. ()

swc_ecma_transforms_react:
 - Don't panic on `createElement()`. ()

swc_bundler:
 - Don't panic on wasm. ()

swc:
 - Disable `inline_globals` if it's not specified. ()
2021-10-20 06:12:21 +00:00
David Sherret
3886eeddd5
fix(es/parser): Fix parsing of a property named async () 2021-10-20 04:31:52 +09:00
Donny/강동윤
bf886bac73
perf(es/parser): Make typescript parser faster ()
swc_ecma_parser:
 - Check for option before backtracking.
2021-10-20 00:00:48 +09:00
Donny/강동윤
123c1f5d02
chore: Fix typo () 2021-10-19 08:25:57 +00:00
Donny/강동윤
9ba68c6863
fix(common): Fix sourcemap ()
swc_common:
 - Include the index to the name in `mappings` of a sourcemap.

swc:
 - Fix handling of `inputSourceMap`.
2021-10-18 06:43:59 +00:00
Donny
7225f90b9c Bump version 2021-10-18 11:09:59 +09:00
Donny/강동윤
ee9177b753
fix(es): Fix bugs ()
swc_ecma_parser:
 - Fix parsing of jsx escapes.

swc_ecma_minifier:
 - Don't mangle name as `const` or `let`. ()

swc_ecma_transforms_react:
 - Fix handling of jsx escapes. ()
2021-10-16 04:25:54 +00:00
Donny/강동윤
4c983e9158
perf(es/codegen, es/parser): Improve performance ()
ast_node:
 - Make `.span()` inlinable.

swc_ecma_codegen:
 - Reduce call to *heavy* `.span()` calls.

swc_ecma_parser:
 - Reduce `memmove` by using typed-arena.

swc_bundler:
 - Make `Bundle.bundle` take `&mut self`.
 - Make drop concurrent.
2021-10-15 12:49:37 +09:00
Donny/강동윤
62f7f655a9
fix(es/minifier): Fix iteration order ()
swc_ecma_minifier:
 - Don't use `AHashMap::drain` for inlining variables.
2021-10-12 10:19:20 +00:00
Pig Fang
9446a037cb
fix(es/parser): Fix class getter/setter ASI bugs () 2021-10-12 18:47:40 +09:00
David Sherret
d114e7d364
refactor(es/parser): Cleanup codes for the comment buffer () 2021-10-12 12:08:06 +09:00
David Sherret
4d4771109a
fix(es/parser): Ensure that comments are collected () 2021-10-12 11:07:52 +09:00
Pig Fang
4ad25d2155
refactor(es/parser): Simplify parsing logic () 2021-10-11 23:09:45 +09:00
Pig Fang
d7f570ff7c
fix(es/parser): Fix async function in SeqExpr () 2021-10-11 12:38:35 +09:00
Pig Fang
4458f9c74d
fix(es/parser): Allow async in TsAsExpr () 2021-10-10 20:22:42 +09:00
Pig Fang
be3dca295b
fix(es/parser): Allow using async as the first one in parameters () 2021-10-10 11:02:32 +09:00
Pig Fang
2379fe1ce0
fix(es/parser): Allow using async as the first one in parameters () 2021-10-09 17:09:09 +09:00
Donny/강동윤
ac3fbd91ac
perf(bundler): Improve performance ()
*:
 - Use `ahash` instread of `rustc-hash`.

swc_ecma_transforms_optimization:
 - Make `dce` parallel.
2021-10-09 08:08:13 +00:00
Pig Fang
644e49c7fa
refactor(es/parser): Simplify parsing logic () 2021-10-09 10:22:47 +09:00
Pig Fang
d65ce85030
fix(es/parser): Report errors for array patterns without comma () 2021-10-07 17:03:06 +09:00
Pig Fang
521e6717ad
fix(es/parser): Report errors for multiple array elements without comma () 2021-10-07 16:08:53 +09:00
Donny/강동윤
a7357ab517
chore: Update rustc () 2021-10-01 12:11:17 +00:00
Donny/강동윤
6a41e9a0be
fix(es): Fix performance bugs ()
swc_common:
 - Optimize `SourceMap.span_until_char`.

swc_ecma_codegen:
 - Make `Emitter` generic.

swc_ecma_parser:
 - `Lexer`: Reuse allocation of `String`.
 - `Lexer`: Avoid copying useless data.
2021-09-29 12:10:38 +00:00
Pig Fang
2b292e6d17
feat(es): Support type-only import/export specifiers () 2021-09-28 22:05:20 +09:00
Donny/강동윤
650e1494d4
fix: Migrate dependencies ()
*:
 - Migrate from `log` to `tracing`. ()
 - Migrate from `fxhash` to `rustc-hash`.

swc_common:
 - Add a cargo feature named `debug`.
2021-09-27 09:19:15 +00:00
Donny/강동윤
e46a842e99
feat(es/parser, es/transform): Implement ergonomic brand checking ()
swc_ecma_parser:
 - Implement parsing of private properties in object literals.

swc_ecma_transforms_base:
 - `fixer`: Handle `const [a = (b, c)]`.

swc_ecma_transforms_compat:
 - `class_properties`: Support ergonomic brand checks. ()

swc_ecma_transforms_proposal:
 - Implement ergonomic brand checks for private fields. ()
2021-09-27 08:03:48 +00:00
Pig Fang
552fc2374d
fix(es/parser): Improve error message ()
swc_ecma_parser:
 - Improve error message for unexpected tokens.
2021-09-26 01:19:08 +09:00
Pig Fang
83153a0f85
fix(es/parser): Report errors for multiple import/export specifiers without comma () 2021-09-25 23:53:57 +09:00
Donny/강동윤
ca0d6ddf2e
fix(es/parser): Fix bugs ()
swc_ecma_parser:
 - Treat `{` after an arrow as a brace stmt. ()
 - Handle comments correctly while backtracking. ()
2021-09-23 11:32:40 +00:00
강동윤
2c477780f0
fix(es): Fix bugs ()
swc_ecma_parser:
 - Don't panic on `typeof import(T)`. ()
 - Fix parsing of ternary. ()

swc_ecma_transforms_base:
 - `fixer`: Handle unary in lhs of an exponentation expression. ()

swc_ecma_transforms_compat:
 - Use variable for `this` in arrow expressions. ()

swc_ecma_visit:
 - Add a trait `InjectVars`.

node_swc:
 - Increease recursion limit while deserializing. ()
2021-09-09 20:45:20 +09:00
Sosuke Suzuki
cbc8230310
fix(es/parser): Fix parsing of static blocks ()
swc_ecma_parser:
 - Fix parsing of static blocks with line breaks. ()
2021-09-03 14:57:23 +09:00
Kitson Kelly
87f30b21a3
feat(common): Add variants to FileName () 2021-09-03 13:55:31 +09:00
강동윤
a8cb554be5
feat: Expose .take() ()
swc_common:
 - Add `Take`. ()

swc_ecma_ast:
 - Implement `Take` for ast nodes. 

swc_ecma_transforms_base:
 - Remove `MapWithMut`.
2021-08-31 14:45:48 +00:00
David Sherret
99c35ff980
refactor(es): Use BlockStmt instead Vec<Stmt> for static blocks. ()
swc_ecma_ast:
 - Use `BlockStmt` instead of `Vec<Stmt>` for static blocks.

swc_ecma_parser:
 - Fix span of static blocks.
2021-08-31 16:12:18 +09:00
David Sherret
2f2e35af69
fix(es/parser): Remove static_blocks from TsConfig () 2021-08-31 14:52:51 +09:00
Sosuke Suzuki
b2c99719fd
feat(es/parser): Add tests for static blocks ()
swc_ecma_parser:
 - Add tests for multiple static blocks in a class.
2021-08-30 12:45:41 +09:00
강동윤
c0b0337d1d
fix(es): Fix easy bugs ()
swc_ecma_parser:
 - Fix parsing of complex arrow expressions in a conditional expression. ()
 - Report an error for wrong jsx, instead of `panic!`. ()

swc_ecma_transforms_react:
 - `jsx`: Handle fragment with single child correctly. ()

swc:
 - Ensure that  is an invalid issue. ()
2021-08-29 20:40:52 +00:00
Sosuke Suzuki
a10118c90f
feat(es/parser, es/codegen, es/visit): Support static blocks in classes ()
swc_ecma_ast:
 - Add support for static blocks in classes.
2021-08-30 00:03:14 +09:00
강동윤
97514a7549
fix(es): Fix some easy bugs ()
swc_ecma_parser:
 - Fix parsing of typescript generics in jsx context. ()

swc_ecma_transforms_base:
 - `fixer`: Handle assignment with patterns in arrow body. ()

swc_ecma_utils:
 - `as_bool`: Handle assignment with operator correctly. ()
2021-08-27 06:03:06 +00:00
Shinobu Hayashi
78a7c6befe
chore(es/parser): Update an error message ()
swc_ecma_parser:
 - Update an error message to match one of `tsc`.
2021-08-25 17:02:14 +09:00
강동윤
c78baef2cc
fix(es/transforms/compat): Implement new.tartet ()
swc_ecma_transforms_compat:
 - Handle `new.target`. ()
2021-08-22 06:56:49 +00:00
Sosuke Suzuki
e3e2908139
feat(es/parser): Report an early error for await used in wrong contexts () 2021-08-21 04:46:22 +09:00
Sosuke Suzuki
33bdff0957
feat(es/parser): Emit an error for top-level await in script ()
swc_ecma_parser:
 - Report an error for a top-level await statements.
2021-08-18 00:17:59 +09:00
강동윤
1b0ef756f2
fix(es/parser): Allow using parser with stable rustc ()
swc_ecma_parser:
 - Don't use `#![feature]` for non-test builds. ()
2021-08-15 10:01:08 +00:00
강동윤
949a4d9716
fix(es): Fix simple bugs ()
swc_ecma_visit:
 - Ensure that  is wrong. ()

swc:
 - Add a test for . ()

node:
 - Make optional fields optional. ()
2021-08-14 18:34:14 +00:00
강동윤
b0067adb9c
fix(es/parser): Fix parsing of function in property names ()
swc_ecma_parser:
 - Use correct token context when `function` is used as the name of a property. ()
2021-08-14 15:12:26 +00:00
강동윤
f6aabfce9c
perf: Use ahash instead of sip hash ()
swc_common:
 - Add `AHashMap`.
 - Add `AHashSet`.
2021-08-14 10:33:16 +00:00
강동윤
b0c41bb3f2
chore: Cleanup codes for fixture testing () 2021-08-14 06:34:04 +00:00