commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
087e76881030f7a44158ba6209b3a8f5ad1c1ef8 | κ°λμ€ | 2020-02-19T03:55:41 | Bump version | diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml
index 62eb53344f..e79ac042dc 100644
--- a/ecmascript/parser/Cargo.toml
+++ b/ecmascript/parser/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_parser"
-version = "0.19.0"
+version = "0.19.1"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
lice... | 1 | 1 | 1 |
f17e49934c456022f5d6bfa23f7ad6af5ea2e338 | κ°λμ€ | 2020-02-15T03:52:06 | Add { Load, Resolve } | diff --git a/ecmascript/utils/Cargo.toml b/ecmascript/utils/Cargo.toml
index f0c9b5438c..fa61977945 100644
--- a/ecmascript/utils/Cargo.toml
+++ b/ecmascript/utils/Cargo.toml
@@ -15,6 +15,7 @@ swc_ecma_ast = { version = "0.17.0", path ="../ast" }
swc_atoms = { version = "0.2.0", path ="../../atoms" }
swc_common = { v... | 4 | 43 | 0 |
f344caa4fa3e8269a4b3a02b3037a99dfda0520b | κ°λμ€ | 2020-02-13T12:55:54 | Reduce binary size (#663)
This pr add two helper macros to prevent folding type unnecessarily.
This reduces the binary size by 3MB on linux. | diff --git a/ecmascript/transforms/src/compat/es2015/arrow.rs b/ecmascript/transforms/src/compat/es2015/arrow.rs
index 0614db1629..3abc159f4a 100644
--- a/ecmascript/transforms/src/compat/es2015/arrow.rs
+++ b/ecmascript/transforms/src/compat/es2015/arrow.rs
@@ -60,6 +60,8 @@ pub fn arrow() -> impl Pass {
struct Arr... | 58 | 288 | 0 |
f26ef0cfb793f943152bba59e89d27834e7b5ab8 | κ°λμ€ | 2020-02-13T06:03:38 | Fix optimizer (#661) | diff --git a/ecmascript/transforms/src/optimization/simplify/dce/mod.rs b/ecmascript/transforms/src/optimization/simplify/dce/mod.rs
index 7aa61ae9a2..1ea85cddb4 100644
--- a/ecmascript/transforms/src/optimization/simplify/dce/mod.rs
+++ b/ecmascript/transforms/src/optimization/simplify/dce/mod.rs
@@ -145,10 +145,7 @@ ... | 4 | 121 | 22 |
f8c358c9ac4d36c33a8ead390e42acbd8004e56c | kdy1 | 2020-02-09T11:35:33 | Strip type-only imports (#641)
Fixes #640 | diff --git a/ecmascript/transforms/src/typescript.rs b/ecmascript/transforms/src/typescript.rs
index 335692e4ec..2d16a8cdca 100644
--- a/ecmascript/transforms/src/typescript.rs
+++ b/ecmascript/transforms/src/typescript.rs
@@ -2,12 +2,11 @@ use crate::{
pass::Pass,
util::{prepend_stmts, var::VarCollector, Exp... | 2 | 30 | 11 |
26eb4e3206009dfe9e81791078a0de18fb9bdaf8 | κ°λμ€ | 2020-02-07T05:32:43 | Collect all comments (#633)
- Comments are now appended
- pin dashmap's version | diff --git a/Cargo.toml b/Cargo.toml
index 8ccec88dd6..acff1fd1cb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ once_cell = "1"
hashbrown = "0.6"
regex = "1"
either = "1"
-dashmap = "3.2.2"
+dashmap = "=3.4.0"
sourcemap = "4.1.1 "
[dev-dependencies]
diff --git a/common/Cargo.toml b/common/Cargo.tom... | 5 | 6 | 6 |
17043ea0874b14e328acdce2bee88f23a89f7a4f | κ°λμ€ | 2020-02-02T14:23:59 | Allow using optional chaning from es | diff --git a/src/config.rs b/src/config.rs
index 39fafc6816..d0b77c3204 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -191,7 +191,7 @@ impl Options {
Optional::new(react::react(cm.clone(), transform.react), syntax.jsx()),
Optional::new(typescript::strip(), syntax.typescript()),
... | 1 | 1 | 1 |
196740cdcd1fb0defa021deb8e46d5c5ae3def71 | kdy1 | 2020-01-31T15:59:47 | Allow optional chaining in ecmascript (#619)
Fixes #618 | diff --git a/ecmascript/parser/src/lib.rs b/ecmascript/parser/src/lib.rs
index 0ca2935b24..cb5dabb638 100644
--- a/ecmascript/parser/src/lib.rs
+++ b/ecmascript/parser/src/lib.rs
@@ -137,6 +137,17 @@ impl Syntax {
}
}
+ pub fn optional_chaining(self) -> bool {
+ match self {
+ Synta... | 2 | 15 | 1 |
8afa3413eaefeb6f036429723e220946c8d2fa8c | κ°λμ€ | 2020-01-30T14:29:12 | Remove dependency on lazy_static and chashmap (#617)
- `lazy_static` is replaced by `once_cell`
- `chashmap` is replaced by `dashmap` | diff --git a/Cargo.toml b/Cargo.toml
index 0a00de7114..6ad0179734 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,11 +21,11 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
failure = "0.1"
path-clean = "0.1"
-lazy_static = "1"
+once_cell = "1"
hashbrown = "0.6"
regex = "1"
either = "1"
-chashm... | 22 | 128 | 148 |
480015d407c74f12f8454e553dd8e65e131ab0ce | kdy1 | 2020-01-24T12:29:57 | block_scoping: handle variable infection (#610)
Handle variable infection in the block scoping pass.
i.e. In the code below, v is 'infected' by i.
```js
var functions = [];
for (let i = 0; i < 10; i++) {
let v = i;
functions.push(function() {
return v;
});
}
functions[0]() // should print ... | diff --git a/ecmascript/transforms/src/compat/es2015/block_scoping.rs b/ecmascript/transforms/src/compat/es2015/block_scoping.rs
index 3d07556e68..328bd1ee2d 100644
--- a/ecmascript/transforms/src/compat/es2015/block_scoping.rs
+++ b/ecmascript/transforms/src/compat/es2015/block_scoping.rs
@@ -2,8 +2,8 @@ use crate::{p... | 2 | 132 | 18 |
08ce8d029323c8c7685739d188c27c7d5d965b64 | erikdesjardins | 2020-01-19T23:22:52 | fix as_bool treating bitor like bitand (#596) | diff --git a/ecmascript/transforms/src/optimization/simplify/dce/tests.rs b/ecmascript/transforms/src/optimization/simplify/dce/tests.rs
index ea5bfca135..f19d51d768 100644
--- a/ecmascript/transforms/src/optimization/simplify/dce/tests.rs
+++ b/ecmascript/transforms/src/optimization/simplify/dce/tests.rs
@@ -145,6 +14... | 2 | 11 | 4 |
288025030996f867efa8ccdb7e498efbb5105deb | κ°λμ€ | 2020-01-17T09:54:40 | Manifest | diff --git a/ecmascript/utils/Cargo.toml b/ecmascript/utils/Cargo.toml
index 19eb3daa9f..78260e7895 100644
--- a/ecmascript/utils/Cargo.toml
+++ b/ecmascript/utils/Cargo.toml
@@ -2,6 +2,10 @@
name = "swc_ecma_utils"
version = "0.2.0"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
+license = "Apache-2.0/MIT"
+repository =... | 1 | 4 | 0 |
44ab37b5a1a7df3b74f34a9a973589c106c84694 | κ°λμ€ | 2020-01-16T04:52:02 | extern crate proc_macro (Fixes #587) | diff --git a/macros/from_variant/Cargo.toml b/macros/from_variant/Cargo.toml
index 730361277f..f75ad620a9 100644
--- a/macros/from_variant/Cargo.toml
+++ b/macros/from_variant/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "from_variant"
-version = "0.1.1"
+version = "0.1.2"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
e... | 2 | 3 | 1 |
11d056c7777fbb06a866b0e91f02876939579911 | κ°λμ€ | 2020-01-15T09:00:08 | Extract FromVariant (#586)
Move FromVariant to a separate crate | diff --git a/common/Cargo.toml b/common/Cargo.toml
index 2501a5d182..64c7ca0fa6 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_common"
-version = "0.4.5"
+version = "0.4.6"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
license = "Apache-2.0/MIT"
repository = "https://githu... | 13 | 51 | 29 |
43c3ee7771248bcfb0eaa233194330c2057b7b24 | κ°λμ€ | 2020-01-15T00:16:33 | Bump version | diff --git a/common/Cargo.toml b/common/Cargo.toml
index ed222e7e4a..2501a5d182 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_common"
-version = "0.4.4"
+version = "0.4.5"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
license = "Apache-2.0/MIT"
repository = "https://githu... | 1 | 1 | 1 |
b7f8282eb1c92f20ad0d846c0314ca758bfdad43 | κ°λμ€ | 2020-01-11T04:29:31 | resolver: handle methods correctly (#579)
swc_ecma_transform:
- handle a class method in child scope (#578) | diff --git a/ecmascript/transforms/src/resolver.rs b/ecmascript/transforms/src/resolver.rs
index 9f32a631c1..b84001e0c4 100644
--- a/ecmascript/transforms/src/resolver.rs
+++ b/ecmascript/transforms/src/resolver.rs
@@ -208,6 +208,27 @@ impl<'a> Fold<FnExpr> for Resolver<'a> {
}
}
+impl Fold<ClassMethod> for Res... | 2 | 137 | 1 |
5503cde0859a058637e967247d75112ba96c0d1a | κ°λμ€ | 2020-01-08T01:55:22 | Extract utils from swc_ecma_transforms (#575)
swc_ecma_transforms:
- extract utils | diff --git a/ecmascript/Cargo.toml b/ecmascript/Cargo.toml
index 0e108cffcd..7f4a644136 100644
--- a/ecmascript/Cargo.toml
+++ b/ecmascript/Cargo.toml
@@ -13,7 +13,8 @@ edition = "2018"
ast = { package = "swc_ecma_ast", path ="./ast" }
codegen = { package = "swc_ecma_codegen", path ="./codegen" }
parser = { package ... | 17 | 197 | 162 |
02d4fb60f26340be904d59cb5441e5a86a77bcd7 | kdy1 | 2020-01-06T01:02:51 | Make capturing fast (#570)
swc_ecma_parser:
- made capturing fast (Closes #533) | diff --git a/ecmascript/parser/examples/lexer.rs b/ecmascript/parser/examples/lexer.rs
index 41361caff0..c999b95b67 100644
--- a/ecmascript/parser/examples/lexer.rs
+++ b/ecmascript/parser/examples/lexer.rs
@@ -1,7 +1,6 @@
-use swc_common;
-
use std::sync::Arc;
use swc_common::{
+ self,
errors::{ColorConfig, ... | 2 | 6 | 7 |
3e0f4a5bd7d247d9ac69ac8bb537a33eadc85f53 | erikdesjardins | 2020-01-05T00:51:40 | dce: preserve nested if statement (#565)
swc_ecma_transforms:
- preserve nested if statements
Co-authored-by: κ°λμ€ <kdy1997.dev@gmail.com> | diff --git a/ecmascript/transforms/src/optimization/simplify/dce/mod.rs b/ecmascript/transforms/src/optimization/simplify/dce/mod.rs
index 843eace02c..f35b620a27 100644
--- a/ecmascript/transforms/src/optimization/simplify/dce/mod.rs
+++ b/ecmascript/transforms/src/optimization/simplify/dce/mod.rs
@@ -179,6 +179,22 @@ ... | 2 | 22 | 0 |
5f6b11348abb49fa9f1d93185f8505ca9db9feb5 | David Sherret | 2020-01-02T07:46:56 | Fix span of the switch statement. (#553) | diff --git a/ecmascript/parser/src/parser/stmt.rs b/ecmascript/parser/src/parser/stmt.rs
index eff46a1cc5..ff8bce93c7 100644
--- a/ecmascript/parser/src/parser/stmt.rs
+++ b/ecmascript/parser/src/parser/stmt.rs
@@ -415,57 +415,49 @@ impl<'a, I: Tokens> Parser<'a, I> {
let discriminant = self.include_in_expr(tr... | 1 | 31 | 39 |
94a81c94929cd3085eac0a56088f653133b769bb | κ°λμ€ | 2020-01-02T04:28:30 | Make .take_all() efficient | diff --git a/common/src/comments.rs b/common/src/comments.rs
index f6370d115d..04d5f088cc 100644
--- a/common/src/comments.rs
+++ b/common/src/comments.rs
@@ -5,7 +5,7 @@ use crate::{
use chashmap::{CHashMap, ReadGuard};
use std::collections::HashMap;
-type CommentMap = CHashMap<BytePos, Vec<Comment>>;
+pub type Co... | 1 | 3 | 11 |
bac1cb52a3d9b9284e4fb5299b977e540537271b | David Sherret | 2020-01-02T04:21:43 | Add a take_all() method to Comments. (#552) | diff --git a/common/src/comments.rs b/common/src/comments.rs
index b8726faa6d..f6370d115d 100644
--- a/common/src/comments.rs
+++ b/common/src/comments.rs
@@ -3,6 +3,7 @@ use crate::{
syntax_pos::{BytePos, Span},
};
use chashmap::{CHashMap, ReadGuard};
+use std::collections::HashMap;
type CommentMap = CHashMa... | 1 | 14 | 0 |
4f76cddebd8197378bc5e6187a9102d10fd608f8 | David Sherret | 2020-01-02T01:18:20 | Fix span of await token in for/for-in/for-of stmts. (#551) | diff --git a/ecmascript/parser/src/parser/stmt.rs b/ecmascript/parser/src/parser/stmt.rs
index 5a25278bbf..eff46a1cc5 100644
--- a/ecmascript/parser/src/parser/stmt.rs
+++ b/ecmascript/parser/src/parser/stmt.rs
@@ -875,8 +875,9 @@ impl<'a, I: Tokens> Parser<'a, I> {
let start = cur_pos!();
assert_an... | 1 | 2 | 1 |
288008091ab8cfa2810577376e30914d67a7b324 | David Sherret | 2020-01-02T01:13:47 | Typo (#550) | diff --git a/ecmascript/ast/src/expr.rs b/ecmascript/ast/src/expr.rs
index c70cf0410c..24e0bc7f1c 100644
--- a/ecmascript/ast/src/expr.rs
+++ b/ecmascript/ast/src/expr.rs
@@ -112,7 +112,7 @@ pub enum Expr {
Paren(ParenExpr),
#[tag("JSXMemberExpression")]
- JSXMebmer(JSXMemberExpr),
+ JSXMember(JSXMemb... | 6 | 7 | 7 |
3cf1caa4b10b1e30dc960140d36a335a111bcdc7 | κ°λμ€ | 2019-12-28T05:05:12 | Bump version | diff --git a/ecmascript/transforms/Cargo.toml b/ecmascript/transforms/Cargo.toml
index 46a2214413..5ac74a6933 100644
--- a/ecmascript/transforms/Cargo.toml
+++ b/ecmascript/transforms/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_transforms"
-version = "0.2.0"
+version = "0.3.0"
authors = ["κ°λμ€ <kdy1997.dev@... | 1 | 1 | 1 |
b98f17b84df8fe034bddd2e5da47fd397e38b9d9 | κ°λμ€ | 2019-12-25T23:53:13 | Bump versions | diff --git a/common/Cargo.toml b/common/Cargo.toml
index 0d89f21937..9ccb3f1564 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_common"
-version = "0.4.2"
+version = "0.4.3"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
license = "Apache-2.0/MIT"
repository = "https://githu... | 2 | 2 | 2 |
32860576f2da213f3c945b893c0538b7f2618a95 | David Sherret | 2019-12-25T23:35:43 | Comment and TokenAndSpan - Implement Spanned (#534) | diff --git a/common/src/comments.rs b/common/src/comments.rs
index a316c80f72..3f8fcbfaf1 100644
--- a/common/src/comments.rs
+++ b/common/src/comments.rs
@@ -1,4 +1,7 @@
-use crate::syntax_pos::{BytePos, Span};
+use crate::{
+ pos::Spanned,
+ syntax_pos::{BytePos, Span},
+};
use chashmap::{CHashMap, ReadGuard};... | 2 | 12 | 3 |
e2764e997b08ecc4fa8df2a739484215e455ff16 | κ°λμ€ | 2019-12-24T09:01:27 | Transform for nullish coalescing operator.
Fixes #526. | diff --git a/ecmascript/transforms/src/proposals.rs b/ecmascript/transforms/src/proposals.rs
index c584e23e28..296a95201a 100644
--- a/ecmascript/transforms/src/proposals.rs
+++ b/ecmascript/transforms/src/proposals.rs
@@ -1,9 +1,10 @@
pub use self::{
class_properties::class_properties, decorators::decorators, ex... | 4 | 221 | 2 |
d8541c4f63bc5d3fe890a298896518defbc1d276 | κ°λμ€ | 2019-12-23T05:37:15 | Fix a bug | diff --git a/ecmascript/ast/Cargo.toml b/ecmascript/ast/Cargo.toml
index 0d0ea52bc5..de1d91fe09 100644
--- a/ecmascript/ast/Cargo.toml
+++ b/ecmascript/ast/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_ast"
-version = "0.12.0"
+version = "0.12.1"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
license = "Apache-2... | 2 | 2 | 2 |
668c2713d9dd3ddb1f6cb61c6f092221996c1a8f | David Sherret | 2019-12-23T05:35:58 | Support numeric separator for typescript. (#524) | diff --git a/ecmascript/parser/src/lib.rs b/ecmascript/parser/src/lib.rs
index de9cca84b7..668fbfc6da 100644
--- a/ecmascript/parser/src/lib.rs
+++ b/ecmascript/parser/src/lib.rs
@@ -160,7 +160,7 @@ impl Syntax {
pub fn num_sep(self) -> bool {
match self {
- Syntax::Es(EsConfig { num_sep: tru... | 1 | 1 | 1 |
f9a649ff7a7325b8f82841658d63544a6483b35b | κ°λμ€ | 2019-12-14T23:15:26 | Bump version | diff --git a/ecmascript/ast/Cargo.toml b/ecmascript/ast/Cargo.toml
index 5a0a53c851..4698ed07c5 100644
--- a/ecmascript/ast/Cargo.toml
+++ b/ecmascript/ast/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_ast"
-version = "0.10.0"
+version = "0.10.1"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
license = "Apache-2... | 1 | 1 | 1 |
fb9539df6f505d4221f30acecd2d1ebb55e9b55f | David Sherret | 2019-12-14T23:08:13 | Expose token module. (#510)
swc_ecma_parser:
- expose token module | diff --git a/ecmascript/parser/src/lib.rs b/ecmascript/parser/src/lib.rs
index f182cfad2e..de9cca84b7 100644
--- a/ecmascript/parser/src/lib.rs
+++ b/ecmascript/parser/src/lib.rs
@@ -109,7 +109,7 @@ mod macros;
mod error;
pub mod lexer;
mod parser;
-mod token;
+pub mod token;
#[derive(Debug, Clone, Copy, Deserial... | 1 | 1 | 1 |
42ad8a92a2eb0991f82272e9a2070fdd933d1e5f | κ°λμ€ | 2019-12-14T09:57:44 | ParseOptions.target | diff --git a/src/config.rs b/src/config.rs
index d608849ddd..dbf1f6ca45 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -38,6 +38,9 @@ pub struct ParseOptions {
#[serde(default = "default_is_module")]
pub is_module: bool,
+
+ #[serde(default)]
+ pub target: JscTarget,
}
#[derive(Default, Seriali... | 1 | 3 | 0 |
6fc91f201789f42df78b6b60b2b4f6d544e26367 | κ°λμ€ | 2019-12-12T23:47:46 | Remove #[inline(never)] | diff --git a/ecmascript/transforms/src/hygiene.rs b/ecmascript/transforms/src/hygiene.rs
index 2123ff5f44..44014c7ff7 100644
--- a/ecmascript/transforms/src/hygiene.rs
+++ b/ecmascript/transforms/src/hygiene.rs
@@ -21,7 +21,6 @@ struct Hygiene<'a> {
}
impl<'a> Hygiene<'a> {
- #[inline(never)]
fn add_declare... | 1 | 1 | 9 |
5076249c907f53235778d6b44d6b83d433b88829 | κ°λμ€ | 2019-12-12T23:38:46 | fixup! Add a test for #503 | diff --git a/ecmascript/parser/examples/typescript.rs b/ecmascript/parser/examples/typescript.rs
new file mode 100644
index 0000000000..05efd6dff0
--- /dev/null
+++ b/ecmascript/parser/examples/typescript.rs
@@ -0,0 +1,48 @@
+use swc_common;
+
+use std::sync::Arc;
+use swc_common::{
+ errors::{ColorConfig, Handler},... | 1 | 48 | 0 |
126b6bc7614acd48d4676b9a8883727e6291678e | κ°λμ€ | 2019-12-12T23:35:32 | Add a test for #503 | diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml
index 48c4a59f30..41098778d9 100644
--- a/ecmascript/parser/Cargo.toml
+++ b/ecmascript/parser/Cargo.toml
@@ -37,4 +37,7 @@ serde_json = "1"
pretty_assertions = "0.6"
[[example]]
-name = "lexer"
\ No newline at end of file
+name = "lexer"
+
+[... | 2 | 13 | 1 |
8622193d040156e63b81b3521d6f8a1580644060 | κ°λμ€ | 2019-12-11T07:18:47 | ParseOptions.is_module | diff --git a/src/config.rs b/src/config.rs
index 4a66aaf569..8ad5549346 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -35,6 +35,9 @@ pub struct ParseOptions {
pub comments: bool,
#[serde(flatten)]
pub syntax: Syntax,
+
+ #[serde(default = "default_is_module")]
+ pub is_module: bool,
}
#[der... | 1 | 3 | 0 |
d53c94f1fb6755eee56c8d6243fc04729768c7b2 | κ°λμ€ | 2019-12-11T06:56:27 | Bump parser's version.
Closes #500 | diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml
index 6d5996c14f..48c4a59f30 100644
--- a/ecmascript/parser/Cargo.toml
+++ b/ecmascript/parser/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_parser"
-version = "0.12.1"
+version = "0.12.2"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
lice... | 1 | 1 | 1 |
fa98c470d6e620015e01f323d0e39a56b9857ec2 | kdy1 | 2019-12-11T06:07:21 | Program instead of Module (#499)
This pr adds an option to parse file as script, not module.
Related: https://github.com/swc-project/swc/issues/491 | diff --git a/ecmascript/ast/src/lib.rs b/ecmascript/ast/src/lib.rs
index a2526a76d3..c6e9fab5ab 100644
--- a/ecmascript/ast/src/lib.rs
+++ b/ecmascript/ast/src/lib.rs
@@ -27,7 +27,7 @@ pub use self::{
JSXOpeningFragment, JSXSpreadChild, JSXText,
},
lit::{Bool, Lit, Null, Number, Regex, RegexFlags, St... | 7 | 65 | 17 |
79128a1d1e8b6c559bf33600aa20c7fa81608364 | Nurbol Alpysbayev | 2019-12-10T22:09:45 | Typo (#497) | diff --git a/ecmascript/parser/examples/lexer.rs b/ecmascript/parser/examples/lexer.rs
index 322fa2fc50..41361caff0 100644
--- a/ecmascript/parser/examples/lexer.rs
+++ b/ecmascript/parser/examples/lexer.rs
@@ -41,7 +41,7 @@ fn main() {
.map_err(|mut e| {
e.emit();
})
- ... | 1 | 1 | 1 |
2f4ce50d06c1a069d768bc683c1002704cf5639f | Nurbol Alpysbayev | 2019-12-10T15:02:39 | Fix the Wasm blocker for Parser (#495) | diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml
index 48df3340ca..6d5996c14f 100644
--- a/ecmascript/parser/Cargo.toml
+++ b/ecmascript/parser/Cargo.toml
@@ -11,15 +11,15 @@ edition = "2018"
[features]
default = []
# Requires nightly.
-fold = ["swc_common/fold", "ast/fold"]
+fold = ["swc_com... | 9 | 13 | 13 |
30869dc3401d804f925a150e95be398587936318 | κ°λμ€ | 2019-12-10T02:57:22 | Fix template_literal in a script | diff --git a/ecmascript/transforms/src/compat/es2015/template_literal.rs b/ecmascript/transforms/src/compat/es2015/template_literal.rs
index 2191a60767..59948c6b59 100644
--- a/ecmascript/transforms/src/compat/es2015/template_literal.rs
+++ b/ecmascript/transforms/src/compat/es2015/template_literal.rs
@@ -21,6 +21,16 @... | 1 | 10 | 0 |
cd486288b79309a45985da9219cecefd862fe8e8 | κ°λμ€ | 2019-12-09T22:23:27 | Bump version | diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml
index 9a39e25b88..48df3340ca 100644
--- a/ecmascript/parser/Cargo.toml
+++ b/ecmascript/parser/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_parser"
-version = "0.12.0"
+version = "0.12.1"
authors = ["κ°λμ€ <kdy1997.dev@gmail.com>"]
lice... | 1 | 1 | 1 |
69e768e6bd126dbec5115f90342b168026cf37bc | κ°λμ€ | 2019-12-04T01:08:17 | Fix codegen of typescript enum (#488)
swc_ecma_trnsnofrms
- Handle export enum | diff --git a/ecmascript/transforms/src/typescript.rs b/ecmascript/transforms/src/typescript.rs
index 2e623494cf..573acdfe55 100644
--- a/ecmascript/transforms/src/typescript.rs
+++ b/ecmascript/transforms/src/typescript.rs
@@ -212,8 +212,24 @@ impl Fold<Vec<ModuleItem>> for Strip {
ModuleItem::ModuleDe... | 2 | 157 | 106 |
3f2477196c972610201163be796fa87ed7e3c37f | κ°λμ€ | 2019-12-01T02:27:28 | Fix typescript enum | diff --git a/ecmascript/transforms/src/typescript/mod.rs b/ecmascript/transforms/src/typescript/mod.rs
index d2eb1f46f5..e5135f4bb6 100644
--- a/ecmascript/transforms/src/typescript/mod.rs
+++ b/ecmascript/transforms/src/typescript/mod.rs
@@ -204,114 +204,243 @@ impl Fold<Vec<ModuleItem>> for Strip {
self.phas... | 2 | 241 | 102 |
0d5da173d20a1db0ea6959125b77798b157091b9 | κ°λμ€ | 2019-11-30T05:51:22 | Remove loc from span | diff --git a/common/src/syntax_pos/span_encoding.rs b/common/src/syntax_pos/span_encoding.rs
index 9788f838ae..3cbec54c47 100644
--- a/common/src/syntax_pos/span_encoding.rs
+++ b/common/src/syntax_pos/span_encoding.rs
@@ -176,30 +176,30 @@ impl Serialize for Span {
s.serialize_field("end", &data.hi)?;
... | 1 | 24 | 24 |
55b473b7441cf2fb83c160d2435f9de368a4a549 | κ°λμ€ | 2019-11-28T11:04:50 | #[serde(transparent)] for SyntaxContext | diff --git a/common/src/syntax_pos/hygiene.rs b/common/src/syntax_pos/hygiene.rs
index e8d911dd95..62ea0cab2c 100644
--- a/common/src/syntax_pos/hygiene.rs
+++ b/common/src/syntax_pos/hygiene.rs
@@ -23,6 +23,7 @@ use std::fmt;
/// A SyntaxContext represents a chain of macro expansions (represented by
/// marks).
#[d... | 1 | 1 | 0 |
4ab510827ac4b09c768e085bf8e40a21d46a3ed9 | κ°λμ€ | 2019-11-28T10:55:14 | Fix serde of BytePos | diff --git a/common/src/syntax_pos/mod.rs b/common/src/syntax_pos/mod.rs
index 7670fee662..de29dcb8b6 100644
--- a/common/src/syntax_pos/mod.rs
+++ b/common/src/syntax_pos/mod.rs
@@ -841,6 +841,7 @@ pub trait Pos {
/// A byte offset. Keep this small (currently 32-bits), as AST contains
/// a lot of them.
#[derive(Cl... | 2 | 3 | 2 |
95a59338d35832072b53283dc95795465f20c28d | κ°λμ€ | 2019-11-28T08:49:08 | Don't omit empty values while serializing | diff --git a/ecmascript/ast/src/class.rs b/ecmascript/ast/src/class.rs
index 0352ae31ad..73e6180290 100644
--- a/ecmascript/ast/src/class.rs
+++ b/ecmascript/ast/src/class.rs
@@ -18,26 +18,26 @@ use swc_common::{ast_node, Span};
pub struct Class {
pub span: Span,
- #[serde(default, skip_serializing_if = "Vec... | 13 | 81 | 145 |
fc9880e4f46e6275a64d4989b5e82178f8cdca9c | κ°λμ€ | 2019-11-24T05:42:08 | Bump parser's version | diff --git a/ecmascript/codegen/Cargo.toml b/ecmascript/codegen/Cargo.toml
index 09f9e78a07..edb916ef98 100644
--- a/ecmascript/codegen/Cargo.toml
+++ b/ecmascript/codegen/Cargo.toml
@@ -19,4 +19,4 @@ sourcemap = "4.1.1"
[dev-dependencies]
testing = { version = "0.4", path ="../../testing" }
-swc_ecma_parser = { ve... | 3 | 3 | 3 |
b46c4ec300294559d56c6b7db433c446e216b24f | κ°λμ€ | 2019-11-24T05:17:27 | Update dependencies (#464) | diff --git a/Cargo.toml b/Cargo.toml
index 9b24451163..c26c964efb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -22,10 +22,10 @@ serde_json = "1"
failure = "0.1"
path-clean = "0.1"
lazy_static = "1"
-hashbrown = "0.5"
+hashbrown = "0.6"
regex = "1"
chashmap = "2.2.2"
-sourcemap = "2.2"
+sourcemap = "4.1.1 "
[[ex... | 30 | 201 | 216 |
7d4168f4157942e8e2d86ebf58c99f6af8355522 | κ°λμ€ | 2019-11-23T14:03:19 | Parser performance (#463)
- Update string_cache from 0.7 to 0.8
- Update unicode_xid from 0.1 to 0.2
swc_ecma_parser:
- Add benchmarks for lexer | diff --git a/atoms/Cargo.toml b/atoms/Cargo.toml
index 2d7c6102c2..a1367dbcff 100644
--- a/atoms/Cargo.toml
+++ b/atoms/Cargo.toml
@@ -10,7 +10,7 @@ description = "Atoms for the swc project."
edition = "2018"
[dependencies]
-string_cache = "0.7"
+string_cache = "0.8"
[build-dependencies]
-string_cache_codegen = ... | 15 | 455 | 139 |
4a80790d7333ce03fc6b96a08c93da5d88893dec | κ°λμ€ | 2019-11-22T12:13:14 | Add benchmark for typescript parser | diff --git a/ecmascript/parser/benches/bench.rs b/ecmascript/parser/benches/bench.rs
index 44b439ebb4..33c9695ad5 100644
--- a/ecmascript/parser/benches/bench.rs
+++ b/ecmascript/parser/benches/bench.rs
@@ -9,45 +9,142 @@ use test::Bencher;
#[bench]
fn colors(b: &mut Bencher) {
// Copied from ratel-rust
- ben... | 1 | 107 | 15 |
107c35fb41368e6e6817d01710077da0779d6b0f | κ°λμ€ | 2019-11-20T12:32:42 | Fix renaming bug related to import (#457)
- Fix renaming bug related to import (#456)
- Add tests for common_js / umd / amd | diff --git a/ecmascript/transforms/src/modules/amd/tests.rs b/ecmascript/transforms/src/modules/amd/tests.rs
index 4668cbce99..29bac33e38 100644
--- a/ecmascript/transforms/src/modules/amd/tests.rs
+++ b/ecmascript/transforms/src/modules/amd/tests.rs
@@ -1109,3 +1109,57 @@ define(["exports"], function (_exports) {
"... | 5 | 213 | 2 |
210686011d8890bfae702687de3172cb52178d02 | κ°λμ€ | 2019-11-19T10:10:15 | Resolver: Handle hoisting (#455)
swc_ecma_transforms:
- resolver: Handle variable hoisting
- resolver: Handle function hoisting | diff --git a/ecmascript/transforms/src/compat/es2015/classes/tests.rs b/ecmascript/transforms/src/compat/es2015/classes/tests.rs
index 3323658e4b..5e6a0e9883 100644
--- a/ecmascript/transforms/src/compat/es2015/classes/tests.rs
+++ b/ecmascript/transforms/src/compat/es2015/classes/tests.rs
@@ -5490,3 +5490,48 @@ expect... | 5 | 280 | 40 |
350f609afd0e12d79fa7a5c906f862cec6a4f755 | κ°λμ€ | 2019-11-15T09:36:43 | Allow accessing same constant from static property and constructor (#445)
Fix #443. | diff --git a/ecmascript/transforms/src/proposals/class_properties/mod.rs b/ecmascript/transforms/src/proposals/class_properties/mod.rs
index 73e9be6097..13aede2d38 100644
--- a/ecmascript/transforms/src/proposals/class_properties/mod.rs
+++ b/ecmascript/transforms/src/proposals/class_properties/mod.rs
@@ -321,9 +321,11... | 4 | 40 | 18 |
96aa4796ea1010d2cdfd9c994cb5233e0e2f4d1b | κ°λμ€ | 2019-11-15T05:23:39 | Fix #441 | diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs
index 58faaa43c5..6ff78eb601 100644
--- a/ecmascript/codegen/src/lib.rs
+++ b/ecmascript/codegen/src/lib.rs
@@ -1644,9 +1644,14 @@ impl<'a> Emitter<'a> {
keyword!("return");
if let Some(ref arg) = node.arg {
let ne... | 1 | 7 | 2 |
25523f45bd30c422bc7aed92f6ba8db5022820c5 | κ°λμ€ | 2019-11-13T11:00:21 | Remove unsafe | diff --git a/ecmascript/parser/src/lexer/jsx.rs b/ecmascript/parser/src/lexer/jsx.rs
index ca4ed93696..ed141f263d 100644
--- a/ecmascript/parser/src/lexer/jsx.rs
+++ b/ecmascript/parser/src/lexer/jsx.rs
@@ -161,7 +161,9 @@ impl<'a, I: Input> Lexer<'a, I> {
if ch == '\\' {
has_escape = true... | 3 | 92 | 21 |
d64d12599615ea7c4a934f5e0e90db7eb243dbf2 | κ°λμ€ | 2019-11-10T09:21:28 | Bugfixes (#440)
* Allow running swc on babel's output (#438)
* Print comments correctly (#439) | diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs
index a041916745..58faaa43c5 100644
--- a/ecmascript/codegen/src/lib.rs
+++ b/ecmascript/codegen/src/lib.rs
@@ -510,7 +510,8 @@ impl<'a> Emitter<'a> {
#[emitter]
pub fn emit_member_expr(&mut self, node: &MemberExpr) -> Result {
- ... | 5 | 48 | 39 |
076957661d0d744f42d9f4a25bcfc921ee8b051e | κ°λμ€ | 2019-11-10T06:23:40 | Fix a test | diff --git a/ecmascript/transforms/src/fixer.rs b/ecmascript/transforms/src/fixer.rs
index 5e1911016a..85c7939d6b 100644
--- a/ecmascript/transforms/src/fixer.rs
+++ b/ecmascript/transforms/src/fixer.rs
@@ -860,6 +860,12 @@ var store = global[SHARED] || (global[SHARED] = {});
.then(() => {})
);
};",
- ... | 1 | 7 | 1 |
264dcf0d7b7757d76417d8b4e072ad013c5a15d8 | κ°λμ€ | 2019-11-10T04:21:44 | Fix #439 | diff --git a/ecmascript/transforms/src/fixer.rs b/ecmascript/transforms/src/fixer.rs
index 1787cb7830..5e1911016a 100644
--- a/ecmascript/transforms/src/fixer.rs
+++ b/ecmascript/transforms/src/fixer.rs
@@ -87,6 +87,31 @@ impl Fold<BlockStmtOrExpr> for Fixer {
}
}
+impl Fold<ReturnStmt> for Fixer {
+ fn fold... | 2 | 52 | 3 |
2add7a08ef422e06b3b7bb9bb1c6d657a44278a7 | κ°λμ€ | 2019-10-23T13:22:54 | fixup! Bump versions | diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml
index b379eb2a0b..9cfba14cb8 100644
--- a/ecmascript/parser/Cargo.toml
+++ b/ecmascript/parser/Cargo.toml
@@ -17,7 +17,7 @@ verify = ["fold"]
[dependencies]
swc_atoms = { version = "0.1", path ="../../atoms" }
swc_common = { version = "0.3", pa... | 1 | 1 | 1 |
4a41140854ec75a41afef3478df9c2adc4a43226 | κ°λμ€ | 2019-10-23T13:20:00 | Bump versions | diff --git a/ecmascript/ast/Cargo.toml b/ecmascript/ast/Cargo.toml
index 6e8eadb54b..f14206ae6d 100644
--- a/ecmascript/ast/Cargo.toml
+++ b/ecmascript/ast/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_ast"
-version = "0.9.2"
+version = "0.9.3"
authors = ["κ°λμ€ <kdy1@outlook.kr>"]
license = "Apache-2.0/MIT"
... | 2 | 2 | 2 |
34c3a0ece92f46b694a50e103bcea18ac39d05d3 | κ°λμ€ | 2019-10-19T03:47:25 | Fix lints | diff --git a/ecmascript/codegen/macros/src/fold.rs b/ecmascript/codegen/macros/src/fold.rs
index c768fafa27..163d4ba17b 100644
--- a/ecmascript/codegen/macros/src/fold.rs
+++ b/ecmascript/codegen/macros/src/fold.rs
@@ -13,7 +13,7 @@ pub(crate) struct InjectSelf {
}
#[cfg(procmacro2_semver_exempt)]
-fn get_joinned_s... | 8 | 18 | 18 |
3a637d422944b5e983fd4befb21586034efb2552 | κ°λμ€ | 2019-10-01T14:42:05 | fix `this` in async generator (#425)
swc_ecma_transforms:
- Don't delete test file when an execution test fails
- fix #400 | diff --git a/ecmascript/transforms/src/compat/es2015/mod.rs b/ecmascript/transforms/src/compat/es2015/mod.rs
index ecc02a52ac..e425e0b909 100644
--- a/ecmascript/transforms/src/compat/es2015/mod.rs
+++ b/ecmascript/transforms/src/compat/es2015/mod.rs
@@ -193,4 +193,92 @@ export var getBadgeBorderRadius = function(text,... | 4 | 175 | 2 |
febe34e280c18944f2e4e384c92f6048614f5283 | κ°λμ€ | 2019-09-22T08:55:35 | Publish swc_ecma_transforms | diff --git a/ecmascript/transforms/Cargo.toml b/ecmascript/transforms/Cargo.toml
index 87caea2b73..8a285801bb 100644
--- a/ecmascript/transforms/Cargo.toml
+++ b/ecmascript/transforms/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_transforms"
-version = "0.1.1"
+version = "0.1.2"
authors = ["κ°λμ€ <kdy1@outlook... | 1 | 1 | 1 |
c20176820ef586259cfed67b1a281b6397b65f11 | κ°λμ€ | 2019-09-20T14:07:24 | Fix #415 | diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs
index 778b462b47..6c3af5baed 100644
--- a/ecmascript/codegen/src/lib.rs
+++ b/ecmascript/codegen/src/lib.rs
@@ -1636,8 +1636,22 @@ impl<'a> Emitter<'a> {
keyword!("return");
if let Some(ref arg) = node.arg {
+ let ... | 3 | 23 | 2 |
eefdaaaa2f779cc5efad0e03e64183cd640dbc0e | κ°λμ€ | 2019-09-20T04:20:37 | Fold expressions in module item (#420)
* Fix #413 | diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs
index 0ce31e93db..778b462b47 100644
--- a/ecmascript/codegen/src/lib.rs
+++ b/ecmascript/codegen/src/lib.rs
@@ -477,6 +477,7 @@ impl<'a> Emitter<'a> {
Expr::TsAs(ref n) => emit!(n),
Expr::TsNonNull(ref n) => emit!(n),
... | 8 | 55 | 10 |
bf70946546b7bb6baa3dee45985a120ea1f354c3 | κ°λμ€ | 2019-09-18T07:14:40 | Fix #417
process.env['X'] is now supported | diff --git a/ecmascript/transforms/src/inline_globals.rs b/ecmascript/transforms/src/inline_globals.rs
index e00d32d668..dfc1e964a5 100644
--- a/ecmascript/transforms/src/inline_globals.rs
+++ b/ecmascript/transforms/src/inline_globals.rs
@@ -59,28 +59,31 @@ impl Fold<Expr> for InlineGlobals {
})),... | 1 | 45 | 20 |
5a47c7a15c0f7e4377e30660672c8ceca6655c75 | κ°λμ€ | 2019-09-18T07:05:36 | Fix `1 - (1 - 1)` (#418) | diff --git a/ecmascript/transforms/src/fixer.rs b/ecmascript/transforms/src/fixer.rs
index 3bf3ff4b1a..a09bc2c693 100644
--- a/ecmascript/transforms/src/fixer.rs
+++ b/ecmascript/transforms/src/fixer.rs
@@ -353,7 +353,7 @@ impl Fold<Expr> for Fixer {
| e @ Expr::Cond(..)
| e @ ... | 1 | 3 | 1 |
a1c25383389ee7d972c76e196d49aae3098055f0 | κ°λμ€ | 2019-06-25T00:38:26 | hashbrown & comment revamp | diff --git a/common/Cargo.toml b/common/Cargo.toml
index 0c1d1db517..58581bd297 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -16,6 +16,7 @@ fold = ["ast_node/fold"]
[dependencies]
ast_node = { version = "0.4", path = "../macros/ast_node" }
string_cache = "0.7"
+chashmap = "2.2"
either = "1.5"
scoped-t... | 27 | 97 | 90 |
07bf194e61b922421584026d033c885cd44e2be1 | Erik Desjardins | 2019-05-16T18:10:06 | Simplify: `left.rhs * right` is only safe when operators are the same | diff --git a/ecmascript/transforms/src/simplify/expr/mod.rs b/ecmascript/transforms/src/simplify/expr/mod.rs
index c375ed4398..d3c4ab46a8 100644
--- a/ecmascript/transforms/src/simplify/expr/mod.rs
+++ b/ecmascript/transforms/src/simplify/expr/mod.rs
@@ -443,9 +443,8 @@ fn fold_bin(
op: left_op,
... | 1 | 8 | 11 |
b5bbbc0cd6b14847306a0dd9647dc94dec88ac56 | κ°λμ€ | 2019-05-02T07:06:42 | publish atoms | diff --git a/atoms/Cargo.toml b/atoms/Cargo.toml
index 25849ea8c0..e78a26b3b0 100644
--- a/atoms/Cargo.toml
+++ b/atoms/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "swc_atoms"
build = "build.rs"
-version = "0.1.1"
+version = "0.1.2"
authors = ["κ°λμ€ <kdy1@outlook.kr>"]
license = "Apache-2.0/MIT"
repository = "http... | 2 | 2 | 2 |
aa06bb7cc9cbb728040773d04fd09a5e61cd61dd | κ°λμ€ | 2019-05-02T06:52:39 | Bump version | diff --git a/common/Cargo.toml b/common/Cargo.toml
index cedf0636a2..0c1d1db517 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_common"
-version = "0.3.0"
+version = "0.3.1"
authors = ["κ°λμ€ <kdy1@outlook.kr>"]
license = "Apache-2.0/MIT"
repository = "https://github.com/... | 2 | 2 | 2 |
ed64a60cb3f8ae850aac6045aa8f74ff6c83e102 | κ°λμ€ | 2019-05-02T06:48:12 | Publish ast / codegen /transforms | diff --git a/ecmascript/ast/Cargo.toml b/ecmascript/ast/Cargo.toml
index 4586a6d7d0..77069cd0a6 100644
--- a/ecmascript/ast/Cargo.toml
+++ b/ecmascript/ast/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "swc_ecma_ast"
-version = "0.9.0"
+version = "0.9.1"
authors = ["κ°λμ€ <kdy1@outlook.kr>"]
license = "Apache-2.0/MIT"
... | 4 | 8 | 9 |
2951546f77d692062fdcb45d70cf3b933775988e | κ°λμ€ | 2019-05-01T10:17:38 | Fix sourcemap.
Closes #349 | diff --git a/ecmascript/codegen/src/text_writer/basic_impl.rs b/ecmascript/codegen/src/text_writer/basic_impl.rs
index 016f2d6968..ef6337da93 100644
--- a/ecmascript/codegen/src/text_writer/basic_impl.rs
+++ b/ecmascript/codegen/src/text_writer/basic_impl.rs
@@ -78,7 +78,7 @@ impl<'a, W: Write> JsWriter<'a, W> {
... | 1 | 1 | 1 |
786117c16c31b8c4f8db6609872ecafbb84c5b51 | κ°λμ€ | 2019-04-30T13:32:06 | Fix #382 | diff --git a/ecmascript/transforms/src/fixer.rs b/ecmascript/transforms/src/fixer.rs
index 0834dd4747..3bf3ff4b1a 100644
--- a/ecmascript/transforms/src/fixer.rs
+++ b/ecmascript/transforms/src/fixer.rs
@@ -350,7 +350,8 @@ impl Fold<Expr> for Fixer {
e @ Expr::Assign(..)
| e @ ... | 1 | 15 | 2 |
0d52148dcd6bce7572192c4942b34af77e4c1cf2 | κ°λμ€ | 2019-04-28T05:58:52 | Bugfixes (#375)
swc_ecma_transforms:
- fix hygiene for decorators (#367)
- add test for react with common js module (#351)
swc_ecma_parser:
- add test for string escape problem (#350) | diff --git a/ecmascript/parser/src/parser/expr/tests.rs b/ecmascript/parser/src/parser/expr/tests.rs
index 29de72bd1c..fac41315dd 100644
--- a/ecmascript/parser/src/parser/expr/tests.rs
+++ b/ecmascript/parser/src/parser/expr/tests.rs
@@ -380,3 +380,19 @@ fn issue_337() {
},
);
}
+
+#[test]
+fn issue_350... | 5 | 98 | 2 |
d40600fd460518b0b7690710419ab46820be43a9 | κ°λμ€ | 2019-04-26T11:33:34 | Make span not optional | diff --git a/ecmascript/ast/src/class.rs b/ecmascript/ast/src/class.rs
index 1603adfb37..0352ae31ad 100644
--- a/ecmascript/ast/src/class.rs
+++ b/ecmascript/ast/src/class.rs
@@ -16,7 +16,6 @@ use swc_common::{ast_node, Span};
#[ast_node]
pub struct Class {
- #[serde(default)]
pub span: Span,
#[serde... | 13 | 0 | 128 |
b329d3463275c902c9550b636fbb8afb4fa6f744 | κ°λμ€ | 2019-04-26T09:01:36 | Fix codegen of async method property | diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs
index 259ea6b48e..dc8ad7918f 100644
--- a/ecmascript/codegen/src/lib.rs
+++ b/ecmascript/codegen/src/lib.rs
@@ -1123,6 +1123,7 @@ impl<'a> Emitter<'a> {
if node.function.is_async {
keyword!("async");
+ space!()... | 1 | 1 | 0 |
d3ff16d4962f0cfa5bee197789cc7b57bc98ddb8 | κ°λμ€ | 2019-04-13T11:55:38 | Emit location while serializing | diff --git a/common/src/pos.rs b/common/src/pos.rs
index 64b21d8506..29ba036205 100644
--- a/common/src/pos.rs
+++ b/common/src/pos.rs
@@ -3,7 +3,7 @@ use fold::{FoldWith, VisitWith};
pub use syntax_pos::{
hygiene, BytePos, CharPos, ExpnInfo, FileName, Globals, Loc, LocWithOpt, Mark, MultiSpan,
SourceFile, S... | 3 | 48 | 2 |
fbbafc5712356135e9714f1f281c93d3530a17c1 | κ°λμ€ | 2019-04-13T11:55:28 | fix lints | diff --git a/macros/ast_node/src/fold.rs b/macros/ast_node/src/fold.rs
index c97f883189..c7c99801a5 100644
--- a/macros/ast_node/src/fold.rs
+++ b/macros/ast_node/src/fold.rs
@@ -202,7 +202,7 @@ fn should_skip_field(field: &Field) -> bool {
}
fn normalize_type_for_bound(ty: Type) -> Type {
- use syn::fold::{self... | 2 | 2 | 2 |
0ffd0755884aaa0a3293bb29b5045e740463f49e | κ°λμ€ | 2019-04-11T12:20:50 | Strip bodyless functions.
Closes #357. | diff --git a/ecmascript/transforms/src/typescript/mod.rs b/ecmascript/transforms/src/typescript/mod.rs
index 66c9997cb3..f723d80166 100644
--- a/ecmascript/transforms/src/typescript/mod.rs
+++ b/ecmascript/transforms/src/typescript/mod.rs
@@ -229,6 +229,22 @@ impl Fold<Vec<ModuleItem>> for Strip {
decl... | 2 | 62 | 1 |
9e333a153c4f5e231f619315014d1b30935c48c6 | κ°λμ€ | 2019-04-11T12:11:21 | Fix #366 | diff --git a/ecmascript/transforms/src/typescript/mod.rs b/ecmascript/transforms/src/typescript/mod.rs
index d032be4cdc..66c9997cb3 100644
--- a/ecmascript/transforms/src/typescript/mod.rs
+++ b/ecmascript/transforms/src/typescript/mod.rs
@@ -165,7 +165,12 @@ impl Fold<Vec<ClassMember>> for Strip {
ClassMe... | 2 | 30 | 1 |
ca220342e015196936d9ede00d174707ee723dce | κ°λμ€ | 2019-04-11T12:04:06 | Fix #365 | diff --git a/ecmascript/transforms/src/fixer.rs b/ecmascript/transforms/src/fixer.rs
index efae556dfd..0834dd4747 100644
--- a/ecmascript/transforms/src/fixer.rs
+++ b/ecmascript/transforms/src/fixer.rs
@@ -454,6 +454,18 @@ impl Fold<Expr> for Fixer {
Expr::Assign(AssignExpr { right, ..expr })
... | 1 | 19 | 0 |
56be56acea291e5c7ed819df0ccef56fa55cdc71 | κ°λμ€ | 2019-04-11T12:01:29 | Fix lints | diff --git a/common/src/errors/mod.rs b/common/src/errors/mod.rs
index 2665ae769d..c3669334a3 100644
--- a/common/src/errors/mod.rs
+++ b/common/src/errors/mod.rs
@@ -116,7 +116,7 @@ impl CodeSuggestion {
/// Returns the assembled code suggestions and whether they should be shown
/// with an underline.
p... | 2 | 2 | 2 |
3cc2e3315dae1c2e6f739e05ab08a47de2525ce0 | Erik Desjardins | 2019-04-09T23:37:43 | Don't emit octal escape for null character followed by digit | diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs
index 6edf26cd6d..259ea6b48e 100644
--- a/ecmascript/codegen/src/lib.rs
+++ b/ecmascript/codegen/src/lib.rs
@@ -358,6 +358,16 @@ impl<'a> Emitter<'a> {
.replace("\r", "\\r")
.replace("\t", "\\t")
.replace('... | 2 | 24 | 0 |
adcc5954eed5c1f170924b8cfe8607ab1d7b1980 | κ°λμ€ | 2019-03-25T03:11:15 | Fix #358 | diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs
index 64e151f2d0..6edf26cd6d 100644
--- a/ecmascript/codegen/src/lib.rs
+++ b/ecmascript/codegen/src/lib.rs
@@ -1111,6 +1111,10 @@ impl<'a> Emitter<'a> {
pub fn emit_method_prop(&mut self, node: &MethodProp) -> Result {
self.emit_l... | 1 | 4 | 0 |
6f970128219af125f839bf11785d5eb351dd06cb | Michael Stewart | 2019-03-23T04:18:55 | fix test imports for latest nightly (#355) | diff --git a/ecmascript/codegen/tests/test262.rs b/ecmascript/codegen/tests/test262.rs
index 03a17fe354..4bbb4209fb 100644
--- a/ecmascript/codegen/tests/test262.rs
+++ b/ecmascript/codegen/tests/test262.rs
@@ -18,7 +18,7 @@ use std::{
use swc_common::comments::Comments;
use swc_ecma_codegen::Emitter;
use swc_ecma_p... | 6 | 12 | 12 |
84973890e7424d6ab582c8fe68272a0dc35e9402 | ε―§ι | 2019-03-19T12:51:12 | Update util.rs (#352)
swc_ecma_parser:
- handle unicode_xid properly | diff --git a/ecmascript/parser/src/lexer/util.rs b/ecmascript/parser/src/lexer/util.rs
index b62d5c8590..11ca533892 100644
--- a/ecmascript/parser/src/lexer/util.rs
+++ b/ecmascript/parser/src/lexer/util.rs
@@ -268,7 +268,7 @@ pub trait CharExt: Copy {
None => return false,
};
// TODO: Us... | 1 | 9 | 12 |
5114dc9e9571d6d9272ee2ecb5333ff454b9bea0 | κ°λμ€ | 2019-03-14T06:54:33 | Extract resolver pass (#344) | diff --git a/ecmascript/transforms/src/compat/es2015/classes/tests.rs b/ecmascript/transforms/src/compat/es2015/classes/tests.rs
index 8cda884466..6237952eb7 100644
--- a/ecmascript/transforms/src/compat/es2015/classes/tests.rs
+++ b/ecmascript/transforms/src/compat/es2015/classes/tests.rs
@@ -1,7 +1,8 @@
use super::*... | 11 | 47 | 18 |
2025f20e8c5ad1d0f7e422f1b0e2c120ec649df2 | κ°λμ€ | 2019-03-10T13:17:08 | Handle imported stuffs in shorthand property. (#333)
swc_ecma_transforms:
- handle imported stuffs in shorthand property (#332) | diff --git a/ecmascript/transforms/src/modules/amd/mod.rs b/ecmascript/transforms/src/modules/amd/mod.rs
index b122931838..bfd6dfc3c2 100644
--- a/ecmascript/transforms/src/modules/amd/mod.rs
+++ b/ecmascript/transforms/src/modules/amd/mod.rs
@@ -537,6 +537,19 @@ impl Fold<Module> for Amd {
}
}
+impl Fold<Prop>... | 7 | 199 | 51 |
dd5f17463ea99f43a57765eab137cd79d9bdf37f | κ°λμ€ | 2019-03-07T13:42:16 | hygiene now handles class name correctly (#323) | diff --git a/ecmascript/transforms/src/hygiene/mod.rs b/ecmascript/transforms/src/hygiene/mod.rs
index 2bebaba3a6..6b83cef164 100644
--- a/ecmascript/transforms/src/hygiene/mod.rs
+++ b/ecmascript/transforms/src/hygiene/mod.rs
@@ -537,6 +537,32 @@ macro_rules! track_ident {
ContinueStmt { label, ..s }
... | 2 | 68 | 0 |
a311f42acf581a5e679590ee1f3779e11b4046a4 | κ°λμ€ | 2019-03-07T06:48:45 | Bugs (#321)
swc_ecma_parser:
- add a test to ensure that \r\n is lexed correctly (#316)
swc_ecma_transforms:
- destructuring pass now handle variable exports correctly (#317)
- es2017::async_to_generator now handles module items. Fix #319.
- prevent hygiene pass from de-exporting class and funcrion (#315) | diff --git a/ecmascript/parser/src/lexer/tests.rs b/ecmascript/parser/src/lexer/tests.rs
index c9e43adc19..c6d43c9f0a 100644
--- a/ecmascript/parser/src/lexer/tests.rs
+++ b/ecmascript/parser/src/lexer/tests.rs
@@ -1062,6 +1062,17 @@ fn issue_299_03() {
);
}
+#[test]
+fn issue_316() {
+ assert_eq!(
+ ... | 10 | 257 | 31 |
b4a391b3a7e0d2f70bd8b4c101f7ce4747b72441 | κ°λμ€ | 2019-03-05T08:44:47 | es2015::destructuring pass (#312)
swc_ecma_transforms:
- es2015::destructuring pass now uses computed member if necessary. (#311) | diff --git a/ecmascript/transforms/src/compat/es2015/destructuring/mod.rs b/ecmascript/transforms/src/compat/es2015/destructuring/mod.rs
index f9602cc9d2..8aa038187b 100644
--- a/ecmascript/transforms/src/compat/es2015/destructuring/mod.rs
+++ b/ecmascript/transforms/src/compat/es2015/destructuring/mod.rs
@@ -226,18 +2... | 2 | 56 | 5 |
5f1641227321bc63fe4aa7fdf4a7b6f5f5697664 | κ°λμ€ | 2019-03-03T08:01:23 | Fix class properties pass (#310)
swc_ecma_transforms:
- Class properties pass handle nested scope correctly (#308) | diff --git a/ecmascript/transforms/src/compat/es2015/resolver/tests.rs b/ecmascript/transforms/src/compat/es2015/resolver/tests.rs
index 11e276a3ea..67a8e2d44c 100644
--- a/ecmascript/transforms/src/compat/es2015/resolver/tests.rs
+++ b/ecmascript/transforms/src/compat/es2015/resolver/tests.rs
@@ -674,3 +674,18 @@ clas... | 3 | 59 | 0 |
b5d3b9a7c741979d28b7c8e29e3df4f1ffa87d9a | κ°λμ€ | 2019-03-02T07:19:19 | Initialize var to undefined in loops (#306)
swc_ecma_transforms:
- block_scoping: initialize var to undefined if it's declared in a loop (#305) | diff --git a/ecmascript/transforms/src/compat/es2015/block_scoping.rs b/ecmascript/transforms/src/compat/es2015/block_scoping.rs
index 96401f358c..637a301889 100644
--- a/ecmascript/transforms/src/compat/es2015/block_scoping.rs
+++ b/ecmascript/transforms/src/compat/es2015/block_scoping.rs
@@ -1,12 +1,132 @@
-use crate... | 2 | 180 | 5 |
5dc4ba181d55b1372b1636426f4a824b0b829137 | κ°λμ€ | 2019-03-01T13:50:43 | Improve fixer (#304)
swc_ecma_transforms:
- fixer: handle member exprssion correctly
- fixer: handle binary expression correctly
- fixer: handle conditional expression correctly
- fixer: handle unary expression correctly | diff --git a/ecmascript/transforms/src/fixer.rs b/ecmascript/transforms/src/fixer.rs
index f110fa634e..1d85276ded 100644
--- a/ecmascript/transforms/src/fixer.rs
+++ b/ecmascript/transforms/src/fixer.rs
@@ -220,6 +220,48 @@ impl Fold<Expr> for Fixer {
computed,
obj: ExprOrSuper::Expr(o... | 1 | 106 | 10 |
1a0f1108a1fb2ce7c0b4d5b567989bf678b02ecb | κ°λμ€ | 2019-03-01T09:18:57 | Bugs (#303)
swc_ecma_transforms:
- report error if jsx namespace is used (#301) | diff --git a/ecmascript/parser/src/lexer/jsx.rs b/ecmascript/parser/src/lexer/jsx.rs
index c85b2d0096..ca4ed93696 100644
--- a/ecmascript/parser/src/lexer/jsx.rs
+++ b/ecmascript/parser/src/lexer/jsx.rs
@@ -205,7 +205,15 @@ impl<'a, I: Input> Lexer<'a, I> {
assert!(self.input.cur().unwrap().is_ident_start());
... | 9 | 119 | 61 |
a2144bbbf59c93ff5fe71d16d562197aefc073b4 | κ°λμ€ | 2019-03-01T07:31:26 | Handle escapes in jsx attributes. Fix #299. | diff --git a/ecmascript/parser/src/lexer/jsx.rs b/ecmascript/parser/src/lexer/jsx.rs
index 73abea5c38..c85b2d0096 100644
--- a/ecmascript/parser/src/lexer/jsx.rs
+++ b/ecmascript/parser/src/lexer/jsx.rs
@@ -144,7 +144,7 @@ impl<'a, I: Input> Lexer<'a, I> {
debug_assert!(self.syntax.jsx());
self.inpu... | 2 | 112 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.