-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(es/transforms): Fix bugs (#1769)
swc_ecma_transforms_optimization: - `dce`: Mark references from decorator as usage. (denoland/deno#10789) swc_ecma_transforms_proposal: - Allow using `super` in decorated class methods. (#846)
- Loading branch information
Showing
22 changed files
with
868 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
authors = ["강동윤 <kdy1997.dev@gmail.com>"] | ||
description = "Helper for transforms for the swc project" | ||
documentation = "https://rustdoc.swc.rs/swc_ecma_transforms_classes/" | ||
edition = "2018" | ||
license = "Apache-2.0/MIT" | ||
name = "swc_ecma_transforms_classes" | ||
repository = "https://github.com/swc-project/swc.git" | ||
version = "0.1.0" | ||
|
||
[dependencies] | ||
swc_atoms = {version = "0.2.6", path = "../../../atoms"} | ||
swc_common = {version = "0.10.20", path = "../../../common"} | ||
swc_ecma_ast = {version = "0.45.0", path = "../../ast"} | ||
swc_ecma_transforms_base = {version = "0.15.5", path = "../base"} | ||
swc_ecma_utils = {version = "0.36.0", path = "../../utils"} | ||
swc_ecma_visit = {version = "0.31.0", path = "../../visit"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use swc_common::DUMMY_SP; | ||
use swc_ecma_ast::*; | ||
use swc_ecma_transforms_base::helper; | ||
use swc_ecma_utils::ExprFactory; | ||
|
||
#[macro_use] | ||
pub mod macros; | ||
pub mod super_field; | ||
|
||
/// Creates | ||
/// | ||
/// ```js | ||
/// Child.__proto__ || Object.getPrototypeOf(Child) | ||
/// ``` | ||
pub fn get_prototype_of(obj: Expr) -> Expr { | ||
Expr::Call(CallExpr { | ||
span: DUMMY_SP, | ||
callee: helper!(get_prototype_of, "getPrototypeOf"), | ||
args: vec![obj.as_arg()], | ||
type_args: Default::default(), | ||
}) | ||
} |
2 changes: 2 additions & 0 deletions
2
...forms/compat/src/es2015/classes/macros.rs → ecmascript/transforms/classes/src/macros.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
ecmascript/transforms/compat/src/es2015/classes/constructor.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.