diff --git a/.gitignore b/.gitignore index 7123c5d0a18..221ac4a81b2 100644 --- a/.gitignore +++ b/.gitignore @@ -45,4 +45,3 @@ pkg/ yarn.lock .idea/ - diff --git a/Cargo.toml b/Cargo.toml index 71758d6fbe9..cad93123ca9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc" repository = "https://github.com/swc-project/swc.git" -version = "0.6.0" +version = "0.6.1" [lib] name = "swc" @@ -26,13 +26,13 @@ serde = {version = "1", features = ["derive"]} serde_json = "1" sourcemap = "6" swc_atoms = {version = "0.2", path = "./atoms"} -swc_common = {version = "0.10", path = "./common", features = ["sourcemap", "concurrent"]} -swc_ecma_ast = {version = "0.39.0", path = "./ecmascript/ast"} -swc_ecma_codegen = {version = "0.46.0", path = "./ecmascript/codegen"} -swc_ecma_ext_transforms = {version = "0.5.0", path = "./ecmascript/ext-transforms"} -swc_ecma_parser = {version = "0.48.0", path = "./ecmascript/parser"} -swc_ecma_preset_env = {version = "0.7.0", path = "./ecmascript/preset_env"} -swc_ecma_transforms = {version = "0.37.0", path = "./ecmascript/transforms", features = [ +swc_common = {version = "0.10.10", path = "./common", features = ["sourcemap", "concurrent"]} +swc_ecma_ast = {version = "0.39.1", path = "./ecmascript/ast"} +swc_ecma_codegen = {version = "0.46.1", path = "./ecmascript/codegen"} +swc_ecma_ext_transforms = {version = "0.5.1", path = "./ecmascript/ext-transforms"} +swc_ecma_parser = {version = "0.48.1", path = "./ecmascript/parser"} +swc_ecma_preset_env = {version = "0.7.1", path = "./ecmascript/preset_env"} +swc_ecma_transforms = {version = "0.37.1", path = "./ecmascript/transforms", features = [ "compat", "module", "optimization", @@ -40,13 +40,13 @@ swc_ecma_transforms = {version = "0.37.0", path = "./ecmascript/transforms", fea "react", "typescript", ]} -swc_ecma_utils = {version = "0.29.0", path = "./ecmascript/utils"} -swc_ecma_visit = {version = "0.25.0", path = "./ecmascript/visit"} -swc_visit = {version = "0.2", path = "./visit"} +swc_ecma_utils = {version = "0.29.1", path = "./ecmascript/utils"} +swc_ecma_visit = {version = "0.25.1", path = "./ecmascript/visit"} +swc_visit = {version = "0.2.3", path = "./visit"} [dev-dependencies] rayon = "1" -testing = {version = "0.10", path = "./testing"} +testing = {version = "0.10.3", path = "./testing"} walkdir = "2" [[example]] diff --git a/bundler/Cargo.toml b/bundler/Cargo.toml index 13c212bf364..088c37d84d1 100644 --- a/bundler/Cargo.toml +++ b/bundler/Cargo.toml @@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"] license = "Apache-2.0/MIT" name = "swc_bundler" repository = "https://github.com/swc-project/swc.git" -version = "0.24.0" +version = "0.24.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] @@ -30,21 +30,21 @@ rayon = {version = "1", optional = true} relative-path = "1.2" retain_mut = "0.1.2" swc_atoms = {version = "0.2.4", path = "../atoms"} -swc_common = {version = "0.10.0", path = "../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ecmascript/ast"} -swc_ecma_codegen = {version = "0.46.0", path = "../ecmascript/codegen"} -swc_ecma_parser = {version = "0.48.0", path = "../ecmascript/parser"} -swc_ecma_transforms = {version = "0.37.0", path = "../ecmascript/transforms", features = ["optimization"]} -swc_ecma_utils = {version = "0.29.0", path = "../ecmascript/utils"} -swc_ecma_visit = {version = "0.25.0", path = "../ecmascript/visit"} +swc_common = {version = "0.10.10", path = "../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ecmascript/ast"} +swc_ecma_codegen = {version = "0.46.1", path = "../ecmascript/codegen"} +swc_ecma_parser = {version = "0.48.1", path = "../ecmascript/parser"} +swc_ecma_transforms = {version = "0.37.1", path = "../ecmascript/transforms", features = ["optimization"]} +swc_ecma_utils = {version = "0.29.1", path = "../ecmascript/utils"} +swc_ecma_visit = {version = "0.25.1", path = "../ecmascript/visit"} [dev-dependencies] hex = "0.4" ntest = "0.7.2" reqwest = {version = "0.10.8", features = ["blocking"]} sha-1 = "0.9" -swc_ecma_transforms = {version = "0.37.0", path = "../ecmascript/transforms", features = ["react", "typescript"]} +swc_ecma_transforms = {version = "0.37.1", path = "../ecmascript/transforms", features = ["react", "typescript"]} tempfile = "3.1.0" -testing = {version = "0.10.0", path = "../testing"} +testing = {version = "0.10.3", path = "../testing"} url = "2.1.1" walkdir = "2" diff --git a/bundler/src/bundler/mod.rs b/bundler/src/bundler/mod.rs index 0b28b3d26c6..7b7f5731f98 100644 --- a/bundler/src/bundler/mod.rs +++ b/bundler/src/bundler/mod.rs @@ -33,7 +33,7 @@ pub struct Config { /// List of modules which should be preserved. pub external_modules: Vec, - /// Type of emiited module + /// Type of emitted module pub module: ModuleType, } diff --git a/common/Cargo.toml b/common/Cargo.toml index 958bfa840fe..c1b0bb3f721 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_common" repository = "https://github.com/swc-project/swc.git" -version = "0.10.9" +version = "0.10.10" [features] concurrent = ["parking_lot"] @@ -15,11 +15,11 @@ tty-emitter = ["atty", "termcolor"] [dependencies] arbitrary = {version = "0.4.7", optional = true, features = ["derive"]} -ast_node = {version = "0.7.1", path = "../macros/ast_node"} +ast_node = {version = "0.7.2", path = "../macros/ast_node"} atty = {version = "0.2", optional = true} cfg-if = "0.1.2" either = "1.5" -from_variant = {version = "0.1", path = "../macros/from_variant"} +from_variant = {version = "0.1.3", path = "../macros/from_variant"} fxhash = "0.2.1" log = "0.4" num-bigint = "0.2" @@ -31,7 +31,7 @@ serde = {version = "1.0.119", features = ["derive"]} sourcemap = {version = "6", optional = true} string_cache = "0.8.1" swc_eq_ignore_macros = {version = "0.1", path = "../macros/eq_ignore"} -swc_visit = {version = "0.2.0", path = "../visit"} +swc_visit = {version = "0.2.3", path = "../visit"} termcolor = {version = "1.0", optional = true} unicode-width = "0.1.4" diff --git a/common/src/errors.rs b/common/src/errors.rs index 7cfe387d162..65ee76c2689 100644 --- a/common/src/errors.rs +++ b/common/src/errors.rs @@ -279,7 +279,7 @@ pub struct Handler { // This set contains the `DiagnosticId` of all emitted diagnostics to avoid // emitting the same diagnostic with extended help (`--teach`) twice, which - // would be uneccessary repetition. + // would be unnecessary repetition. taught_diagnostics: Lock>, /// Used to suggest rustc --explain diff --git a/common/src/lib.rs b/common/src/lib.rs index 185f0f41b44..7ab59f46e5a 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -10,7 +10,7 @@ //! //! ## `sourcemap` //! -//! Adds methods to generator web sourcemap. +//! Adds methods to generate web sourcemap. #![deny(unused)] pub use self::eq::EqIgnoreSpan; diff --git a/common/src/macros.rs b/common/src/macros.rs index 7db6c5b2a89..ce44fc79315 100644 --- a/common/src/macros.rs +++ b/common/src/macros.rs @@ -149,7 +149,7 @@ macro_rules! value_of_bitflag { ($e:expr) => { $e }; } -/// rustfmt-friendly version of `bitblags!`. +/// rustfmt-friendly version of `bitflags!`. #[macro_export] macro_rules! add_bitflags { // Done diff --git a/common/src/sync.rs b/common/src/sync.rs index ac56cf8f977..e2ce4864a28 100644 --- a/common/src/sync.rs +++ b/common/src/sync.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! This module defines types which are thread safe if cfg!(feature = -//! "concurrent") is true. +//! This module defines types which are thread safe if `cfg!(feature = +//! "concurrent")` is true. //! //! `Lrc` is an alias of either Rc or Arc. //! diff --git a/common/src/syntax_pos.rs b/common/src/syntax_pos.rs index 0a9ec9644cb..5d94989e3a3 100644 --- a/common/src/syntax_pos.rs +++ b/common/src/syntax_pos.rs @@ -14,13 +14,13 @@ mod analyze_source_file; pub mod hygiene; /// Spans represent a region of code, used for error reporting. Positions in -/// spans are *absolute* positions from the beginning of the source_map, not -/// positions relative to SourceFiles. Methods on the SourceMap can be used to -/// relate spans back to the original source. +/// spans are *absolute* positions from the beginning of the `source_map`, not +/// positions relative to `SourceFile`s. Methods on the `SourceMap` can be used +/// to relate spans back to the original source. /// You must be careful if the span crosses more than one file - you will not be -/// able to use many of the functions on spans in source_map and you cannot -/// assume that the length of the span = hi - lo; there may be space in the -/// BytePos range between files. +/// able to use many of the functions on spans in `source_map` and you cannot +/// assume that the length of the `span = hi - lo`; there may be space in the +/// `BytePos` range between files. #[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, Ord, PartialOrd, Serialize, Deserialize)] pub struct Span { #[serde(rename = "start")] @@ -559,24 +559,25 @@ impl Sub for NonNarrowChar { /// A single source in the SourceMap. #[derive(Clone)] pub struct SourceFile { - /// The name of the file that the source came from, source that doesn't + /// The name of the file that the source came from. Source that doesn't /// originate from files has names between angle brackets by convention, /// e.g. `` pub name: FileName, - /// True if the `name` field above has been modified by --remap-path-prefix + /// True if the `name` field above has been modified by + /// `--remap-path-prefix` pub name_was_remapped: bool, /// The unmapped path of the file that the source came from. - /// Set to `None` if the SourceFile was imported from an external crate. + /// Set to `None` if the `SourceFile` was imported from an external crate. pub unmapped_path: Option, - /// Indicates which crate this SourceFile was imported from. + /// Indicates which crate this `SourceFile` was imported from. pub crate_of_origin: u32, /// The complete source code pub src: Lrc, /// The source code's hash pub src_hash: u128, - /// The start position of this source in the SourceMap + /// The start position of this source in the `SourceMap` pub start_pos: BytePos, - /// The end position of this source in the SourceMap + /// The end position of this source in the `SourceMap` pub end_pos: BytePos, /// Locations of lines beginnings in the source code pub lines: Vec, @@ -681,8 +682,8 @@ impl SourceFile { /// Find the line containing the given position. The return value is the /// index into the `lines` array of this SourceFile, not the 1-based line - /// number. If the source_file is empty or the position is located before - /// the first line, None is returned. + /// number. If the `source_file` is empty or the position is located before + /// the first line, `None` is returned. pub fn lookup_line(&self, pos: BytePos) -> Option { if self.lines.is_empty() { return None; @@ -847,7 +848,7 @@ pub struct Loc { pub col_display: usize, } -/// A source code location used as the result of lookup_char_pos_adj +/// A source code location used as the result of `lookup_char_pos_adj` // Actually, *none* of the clients use the filename *or* file field; // perhaps they should just be removed. #[derive(Debug)] diff --git a/ecmascript/Cargo.toml b/ecmascript/Cargo.toml index a7e12d603ce..1e78d390221 100644 --- a/ecmascript/Cargo.toml +++ b/ecmascript/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecmascript" repository = "https://github.com/swc-project/swc.git" -version = "0.23.0" +version = "0.23.1" [package.metadata.docs.rs] all-features = true @@ -27,12 +27,12 @@ react = ["swc_ecma_transforms/react"] typescript = ["swc_ecma_transforms/typescript"] [dependencies] -swc_ecma_ast = {version = "0.39.0", path = "./ast"} -swc_ecma_codegen = {version = "0.46.0", path = "./codegen", optional = true} -swc_ecma_dep_graph = {version = "0.16.0", path = "./dep-graph", optional = true} -swc_ecma_parser = {version = "0.48.0", path = "./parser", optional = true} -swc_ecma_transforms = {version = "0.37.0", path = "./transforms", optional = true} -swc_ecma_utils = {version = "0.29.0", path = "./utils", optional = true} -swc_ecma_visit = {version = "0.25.0", path = "./visit", optional = true} +swc_ecma_ast = {version = "0.39.1", path = "./ast"} +swc_ecma_codegen = {version = "0.46.1", path = "./codegen", optional = true} +swc_ecma_dep_graph = {version = "0.16.1", path = "./dep-graph", optional = true} +swc_ecma_parser = {version = "0.48.1", path = "./parser", optional = true} +swc_ecma_transforms = {version = "0.37.1", path = "./transforms", optional = true} +swc_ecma_utils = {version = "0.29.1", path = "./utils", optional = true} +swc_ecma_visit = {version = "0.25.1", path = "./visit", optional = true} [dev-dependencies] diff --git a/ecmascript/ast/Cargo.toml b/ecmascript/ast/Cargo.toml index c020738b2d5..e8f438e6b9a 100644 --- a/ecmascript/ast/Cargo.toml +++ b/ecmascript/ast/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_ast" repository = "https://github.com/swc-project/swc.git" -version = "0.39.0" +version = "0.39.1" [features] default = [] @@ -17,9 +17,9 @@ arbitrary = {version = "0.4.7", optional = true, features = ["derive"]} is-macro = "0.1" num-bigint = {version = "0.2", features = ["serde"]} serde = {version = "1.0.88", features = ["derive"]} -string_enum = {version = "0.3", path = "../../macros/string_enum"} +string_enum = {version = "0.3.1", path = "../../macros/string_enum"} swc_atoms = {version = "0.2", path = "../../atoms"} -swc_common = {version = "0.10.8", path = "../../common"} +swc_common = {version = "0.10.10", path = "../../common"} [dev-dependencies] serde_json = "1" diff --git a/ecmascript/ast/src/decl.rs b/ecmascript/ast/src/decl.rs index 59fa6d9504a..2f26810af39 100644 --- a/ecmascript/ast/src/decl.rs +++ b/ecmascript/ast/src/decl.rs @@ -96,7 +96,7 @@ pub struct VarDeclarator { #[serde(rename = "id")] pub name: Pat, - /// Initialization expresion. + /// Initialization expression. #[serde(default)] pub init: Option>, diff --git a/ecmascript/ast/src/jsx.rs b/ecmascript/ast/src/jsx.rs index b04e2c35768..8ac0d22a17d 100644 --- a/ecmascript/ast/src/jsx.rs +++ b/ecmascript/ast/src/jsx.rs @@ -108,7 +108,7 @@ pub struct JSXOpeningElement { #[serde(rename = "selfClosing")] pub self_closing: bool, - /// Note: This field's name is differrent from one from babel because it is + /// Note: This field's name is different from one from babel because it is /// misleading #[serde(default, rename = "typeArguments")] pub type_args: Option, diff --git a/ecmascript/ast/src/lib.rs b/ecmascript/ast/src/lib.rs index 3d93715387a..5b00d7ba1a3 100644 --- a/ecmascript/ast/src/lib.rs +++ b/ecmascript/ast/src/lib.rs @@ -116,7 +116,7 @@ pub enum EsVersion { impl EsVersion { /// Get the latest version. This is `es2020` for now, but it will be changed - /// if a new version of specification is realeased. + /// if a new version of specification is released. pub const fn latest() -> Self { EsVersion::Es2020 } diff --git a/ecmascript/ast/src/pat.rs b/ecmascript/ast/src/pat.rs index a5a53e5b9b0..e14022df90b 100644 --- a/ecmascript/ast/src/pat.rs +++ b/ecmascript/ast/src/pat.rs @@ -32,7 +32,7 @@ pub enum Pat { #[tag("Invalid")] Invalid(Invalid), - /// Only for for-in / for-of loops. This is *syntatically* valid. + /// Only for for-in / for-of loops. This is *syntactically* valid. #[tag("*")] Expr(Box), } diff --git a/ecmascript/codegen/Cargo.toml b/ecmascript/codegen/Cargo.toml index 92696c60986..bbd4137a1ee 100644 --- a/ecmascript/codegen/Cargo.toml +++ b/ecmascript/codegen/Cargo.toml @@ -7,18 +7,18 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0/MIT" name = "swc_ecma_codegen" repository = "https://github.com/swc-project/swc.git" -version = "0.46.0" +version = "0.46.1" [dependencies] bitflags = "1" num-bigint = {version = "0.2", features = ["serde"]} sourcemap = "6" swc_atoms = {version = "0.2", path = "../../atoms"} -swc_common = {version = "0.10.0", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_codegen_macros = {version = "0.5", path = "./macros"} -swc_ecma_parser = {version = "0.48.0", path = "../parser"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_codegen_macros = {version = "0.5.2", path = "./macros"} +swc_ecma_parser = {version = "0.48.1", path = "../parser"} [dev-dependencies] -swc_common = {version = "0.10.0", path = "../../common", features = ["sourcemap"]} -testing = {version = "0.10.0", path = "../../testing"} +swc_common = {version = "0.10.10", path = "../../common", features = ["sourcemap"]} +testing = {version = "0.10.3", path = "../../testing"} diff --git a/ecmascript/codegen/macros/Cargo.toml b/ecmascript/codegen/macros/Cargo.toml index a32b44f3a10..b33759abf39 100644 --- a/ecmascript/codegen/macros/Cargo.toml +++ b/ecmascript/codegen/macros/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_codegen_macros" repository = "https://github.com/swc-project/swc.git" -version = "0.5.1" +version = "0.5.2" [lib] proc-macro = true @@ -14,7 +14,7 @@ proc-macro = true [dependencies] pmutil = "0.5.1" proc-macro2 = "1" -swc_macros_common = {version = "0.3", path = "../../../macros/common"} +swc_macros_common = {version = "0.3.2", path = "../../../macros/common"} [dependencies.syn] features = ["fold"] diff --git a/ecmascript/codegen/macros/src/fold.rs b/ecmascript/codegen/macros/src/fold.rs index 431e3bbf435..9f00bcbe9e0 100644 --- a/ecmascript/codegen/macros/src/fold.rs +++ b/ecmascript/codegen/macros/src/fold.rs @@ -14,7 +14,7 @@ pub(crate) struct InjectSelf { } #[cfg(procmacro2_semver_exempt)] -fn get_joinned_span(t: &dyn ToTokens) -> Span { +fn get_joined_span(t: &dyn ToTokens) -> Span { let tts: TokenStream = t.dump().into(); let (mut first, mut last) = (None, None); for tt in tts { @@ -30,7 +30,7 @@ fn get_joinned_span(t: &dyn ToTokens) -> Span { } #[cfg(not(procmacro2_semver_exempt))] -fn get_joinned_span(t: &dyn ToTokens) -> Span { +fn get_joined_span(t: &dyn ToTokens) -> Span { let tts: TokenStream = t.dump(); let mut first = None; for tt in tts { @@ -80,7 +80,7 @@ impl Fold for InjectSelf { }; let name = i.path.dump().to_string(); - let span = get_joinned_span(&i.path); + let span = get_joined_span(&i.path); match &*name { "smallvec" | "vec" | "unreachable" | "tok" | "op" | "js_word" => i, diff --git a/ecmascript/dep-graph/Cargo.toml b/ecmascript/dep-graph/Cargo.toml index 8a961393cac..aaa3efce1af 100644 --- a/ecmascript/dep-graph/Cargo.toml +++ b/ecmascript/dep-graph/Cargo.toml @@ -6,14 +6,14 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_dep_graph" repository = "https://github.com/swc-project/swc.git" -version = "0.16.0" +version = "0.16.1" [dependencies] swc_atoms = {version = "0.2", path = "../../atoms"} -swc_common = {version = "0.10.1", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_visit = {version = "0.25.0", path = "../visit"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_visit = {version = "0.25.1", path = "../visit"} [dev-dependencies] -swc_ecma_parser = {version = "0.48.0", path = "../parser"} -testing = {version = "0.10.0", path = "../../testing"} +swc_ecma_parser = {version = "0.48.1", path = "../parser"} +testing = {version = "0.10.3", path = "../../testing"} diff --git a/ecmascript/ext-transforms/Cargo.toml b/ecmascript/ext-transforms/Cargo.toml index 9403635bbac..de90d68aa29 100644 --- a/ecmascript/ext-transforms/Cargo.toml +++ b/ecmascript/ext-transforms/Cargo.toml @@ -5,15 +5,15 @@ documentation = "https://swc.rs/rustdoc/swc_ecma_ext_transforms/" edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_ext_transforms" -version = "0.5.0" +version = "0.5.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] phf = {version = "0.8.0", features = ["macros"]} swc_atoms = {version = "0.2", path = "../../atoms"} -swc_common = {version = "0.10", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../parser"} -swc_ecma_utils = {version = "0.29.0", path = "../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../visit"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../parser"} +swc_ecma_utils = {version = "0.29.1", path = "../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../visit"} diff --git a/ecmascript/jsdoc/Cargo.toml b/ecmascript/jsdoc/Cargo.toml index b5b01095648..599a0f1ddc6 100644 --- a/ecmascript/jsdoc/Cargo.toml +++ b/ecmascript/jsdoc/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://swc.rs/rustdoc/jsdoc/" edition = "2018" license = "Apache-2.0/MIT" name = "jsdoc" -version = "0.16.0" +version = "0.16.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -13,12 +13,12 @@ version = "0.16.0" nom = "5.1.2" serde = {version = "1", features = ["derive"]} swc_atoms = {version = "0.2", path = "../../atoms"} -swc_common = {version = "0.10.0", path = "../../common"} +swc_common = {version = "0.10.10", path = "../../common"} [dev-dependencies] anyhow = "1" dashmap = "3" -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../parser"} -testing = {version = "0.10.0", path = "../../testing"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../parser"} +testing = {version = "0.10.3", path = "../../testing"} walkdir = "2" diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml index f1a125019c7..d8559f0bbd5 100644 --- a/ecmascript/parser/Cargo.toml +++ b/ecmascript/parser/Cargo.toml @@ -7,30 +7,30 @@ include = ["Cargo.toml", "src/**/*.rs", "examples/**/*.rs"] license = "Apache-2.0/MIT" name = "swc_ecma_parser" repository = "https://github.com/swc-project/swc.git" -version = "0.48.0" +version = "0.48.1" [features] default = [] [dependencies] either = {version = "1.4"} -enum_kind = {version = "0.2", path = "../../macros/enum_kind"} +enum_kind = {version = "0.2.1", path = "../../macros/enum_kind"} fxhash = "0.2.1" log = "0.4" num-bigint = "0.2" serde = {version = "1", features = ["derive"]} smallvec = "1" swc_atoms = {version = "0.2.3", path = "../../atoms"} -swc_common = {version = "0.10.0", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_visit = {version = "0.25.0", path = "../visit"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_visit = {version = "0.25.1", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] env_logger = "0.7" pretty_assertions = "0.6" serde_json = "1" -testing = {version = "0.10.0", path = "../../testing"} +testing = {version = "0.10.3", path = "../../testing"} walkdir = "2" [[example]] diff --git a/ecmascript/parser/benches/compare.rs b/ecmascript/parser/benches/compare.rs index 1df455c6b5e..af7a70c0a45 100644 --- a/ecmascript/parser/benches/compare.rs +++ b/ecmascript/parser/benches/compare.rs @@ -85,7 +85,7 @@ fn fold_span(b: &mut Bencher) { } #[bench] -fn fold_span_pnic(b: &mut Bencher) { +fn fold_span_panic(b: &mut Bencher) { struct RespanFold; impl Fold for RespanFold { diff --git a/ecmascript/parser/src/error.rs b/ecmascript/parser/src/error.rs index edc82bf59b2..69bfc292d61 100644 --- a/ecmascript/parser/src/error.rs +++ b/ecmascript/parser/src/error.rs @@ -80,7 +80,7 @@ pub enum SyntaxError { /// "implements", "interface", "let", "package",\ /// "private", "protected", "public", "static", or "yield" InvalidIdentInStrict, - /// 'eval' and 'arguments' are invalid identfier in strict mode. + /// 'eval' and 'arguments' are invalid identifier in strict mode. EvalAndArgumentsInStrict, UnaryInExp { left: String, @@ -259,8 +259,8 @@ impl SyntaxError { SyntaxError::IdentAfterNum => "Identifier cannot follow number".into(), SyntaxError::UnexpectedChar { c } => format!("Unexpected character {:?}", c).into(), SyntaxError::InvalidStrEscape => "Invalid string escape".into(), - SyntaxError::InvalidUnicodeEscape => "Invalid unciode escape".into(), - SyntaxError::InvalidCodePoint => "Invalid unciode code point".into(), + SyntaxError::InvalidUnicodeEscape => "Invalid unicode escape".into(), + SyntaxError::InvalidCodePoint => "Invalid unicode code point".into(), SyntaxError::ExpectedHexChars { count } => { format!("Expected {} hex characters", count).into() } @@ -313,7 +313,7 @@ impl SyntaxError { SyntaxError::SpreadInParenExpr => { "Parenthesized expression cannot contain spread operator".into() } - SyntaxError::EmptyParenExpr => "Parenthized expression cannot be empty".into(), + SyntaxError::EmptyParenExpr => "Parenthesized expression cannot be empty".into(), SyntaxError::InvalidPat => "Not a pattern".into(), SyntaxError::InvalidExpr => "Not an expression".into(), // TODO @@ -420,7 +420,7 @@ impl SyntaxError { } SyntaxError::TS1056 => { - "jsc.taraget should be es5 or upper to use getter / setter".into() + "jsc.target should be es5 or upper to use getter / setter".into() } SyntaxError::TS1110 => "type expected".into(), SyntaxError::TS1141 => "literal in an import type should be string literal".into(), @@ -430,11 +430,11 @@ impl SyntaxError { SyntaxError::TS2703 => { "The operand of a delete operator must be a property reference.".into() } - SyntaxError::DeclNotAllowed => "Declatation is now allowed".into(), + SyntaxError::DeclNotAllowed => "Declaration is now allowed".into(), SyntaxError::InvalidSuperCall => "Invalid `super()`".into(), SyntaxError::InvalidSuper => "Invalid access to super".into(), SyntaxError::ArrowNotAllowed => "An arrow function is not allowed here".into(), - SyntaxError::ExportNotAllowed => "`export` is not aloowed here".into(), + SyntaxError::ExportNotAllowed => "`export` is not allowed here".into(), SyntaxError::GetterSetterCannotBeReadonly => { "A getter or a setter cannot be readonly".into() } diff --git a/ecmascript/parser/src/lexer/mod.rs b/ecmascript/parser/src/lexer/mod.rs index 788c40a259d..0582bc423d7 100644 --- a/ecmascript/parser/src/lexer/mod.rs +++ b/ecmascript/parser/src/lexer/mod.rs @@ -482,7 +482,7 @@ impl<'a, I: Input> Lexer<'a, I> { } } - /// Read an escaped charater for string literal. + /// Read an escaped character for string literal. /// /// In template literal, we should preserve raw string. fn read_escaped_char(&mut self, raw: &mut Raw) -> LexResult> { @@ -828,7 +828,7 @@ impl<'a, I: Input> Lexer<'a, I> { /// /// - /// THis method returns [Char] as non-utf8 character is valid in javsacript. + /// This method returns [Char] as non-utf8 character is valid in JavaScript. /// See https://github.com/swc-project/swc/issues/261 fn read_hex_char(&mut self, start: BytePos, count: u8, raw: &mut Raw) -> LexResult { debug_assert!(count == 2 || count == 4); @@ -921,7 +921,7 @@ impl<'a, I: Input> Lexer<'a, I> { match c { '[' => in_class = true, ']' if in_class => in_class = false, - // Termniates content part of regex literal + // Terminates content part of regex literal '/' if !in_class => break, _ => {} } diff --git a/ecmascript/parser/src/lexer/state.rs b/ecmascript/parser/src/lexer/state.rs index a9863df2d98..1fd92187b95 100644 --- a/ecmascript/parser/src/lexer/state.rs +++ b/ecmascript/parser/src/lexer/state.rs @@ -620,7 +620,7 @@ impl TokenContexts { /// given point in the program is loosely based on sweet.js' approach. /// See https://github.com/mozilla/sweet.js/wiki/design #[derive(Debug, Clone, Copy, PartialEq, Eq, Kind)] -#[kind(fucntion(is_expr = "bool", preserve_space = "bool"))] +#[kind(function(is_expr = "bool", preserve_space = "bool"))] pub enum TokenContext { BraceStmt, #[kind(is_expr)] diff --git a/ecmascript/parser/src/lexer/tests.rs b/ecmascript/parser/src/lexer/tests.rs index 13a9133ef91..84070a1ec0b 100644 --- a/ecmascript/parser/src/lexer/tests.rs +++ b/ecmascript/parser/src/lexer/tests.rs @@ -1187,7 +1187,7 @@ fn lex_escaped_char(b: &mut Bencher) { } #[bench] -fn lex_legact_octal_lit(b: &mut Bencher) { +fn lex_legacy_octal_lit(b: &mut Bencher) { bench_simple( b, "01756123617;01756123617;01756123617;01756123617;01756123617;01756123617;01756123617;\ diff --git a/ecmascript/parser/src/lib.rs b/ecmascript/parser/src/lib.rs index 50176740d14..e2a007c8b55 100644 --- a/ecmascript/parser/src/lib.rs +++ b/ecmascript/parser/src/lib.rs @@ -18,13 +18,13 @@ //! //! ## Error recovery //! -//! The parser can recover from some parsing erros. For example, parser returns +//! The parser can recover from some parsing errors. For example, parser returns //! `Ok(Module)` for the code below, while emitting error to handler. //! //! ```ts //! const CONST = 9000 % 2; //! const enum D { -//! // Comma is requied, but parser can recover because of the newline. +//! // Comma is required, but parser can recover because of the newline. //! d = 10 //! g = CONST //! } diff --git a/ecmascript/parser/src/parser/expr.rs b/ecmascript/parser/src/parser/expr.rs index 8489211a0a3..0269f6bd2f3 100644 --- a/ecmascript/parser/src/parser/expr.rs +++ b/ecmascript/parser/src/parser/expr.rs @@ -31,7 +31,7 @@ impl<'a, I: Tokens> Parser { Ok(expr) } - ///`parseMaybeAssign` (overrided) + ///`parseMaybeAssign` (overridden) pub(super) fn parse_assignment_expr(&mut self) -> PResult> { trace_cur!(self, parse_assignment_expr); @@ -520,7 +520,7 @@ impl<'a, I: Tokens> Parser { self.parse_subscripts(ExprOrSuper::Expr(obj), true) } - /// Parse `NewExpresion`. + /// Parse `NewExpression`. /// This includes `MemberExpression`. pub(super) fn parse_new_expr(&mut self) -> PResult> { trace_cur!(self, parse_new_expr); diff --git a/ecmascript/parser/src/parser/input.rs b/ecmascript/parser/src/parser/input.rs index d6df99513ae..72769af3731 100644 --- a/ecmascript/parser/src/parser/input.rs +++ b/ecmascript/parser/src/parser/input.rs @@ -30,7 +30,7 @@ pub trait Tokens: Clone + Iterator { /// Add an error which is valid syntax in script mode. /// - /// This errors should be dropped if it's not a moduloe. + /// This errors should be dropped if it's not a module. /// /// Implementor should check for if [Context].module, and buffer errors if /// module is false. Also, implementors should move errors to the error diff --git a/ecmascript/parser/src/parser/mod.rs b/ecmascript/parser/src/parser/mod.rs index 19440509046..29164f8a4e1 100644 --- a/ecmascript/parser/src/parser/mod.rs +++ b/ecmascript/parser/src/parser/mod.rs @@ -119,7 +119,7 @@ impl Parser { }) } - /// Returns [Module] if it'a module and returns [Script] if it's not a + /// Returns [Module] if it's a module and returns [Script] if it's not a /// module. /// /// Note: This is not perfect yet. It means, some strict mode violations may diff --git a/ecmascript/parser/src/parser/object.rs b/ecmascript/parser/src/parser/object.rs index 23ad338dc89..a8e1e3adf64 100644 --- a/ecmascript/parser/src/parser/object.rs +++ b/ecmascript/parser/src/parser/object.rs @@ -414,7 +414,7 @@ impl ParseObject for Parser { let start = cur_pos!(self); if eat!(self, "...") { - // spread elemnent + // spread element let dot3_token = span!(self, start); let arg = Box::new(self.parse_binding_pat_or_ident()?); diff --git a/ecmascript/parser/src/parser/pat.rs b/ecmascript/parser/src/parser/pat.rs index 266b0fd54c6..26543630cff 100644 --- a/ecmascript/parser/src/parser/pat.rs +++ b/ecmascript/parser/src/parser/pat.rs @@ -436,7 +436,7 @@ impl<'a, I: Tokens> Parser { pub enum PatType { BindingPat, BindingElement, - /// AssigmentPattern + /// AssignmentPattern AssignPat, AssignElement, } @@ -540,7 +540,7 @@ impl<'a, I: Tokens> Parser { } } - // It's special because of optional intializer + // It's special because of optional initializer Expr::Assign(..) => {} _ => self.emit_err(span, SyntaxError::InvalidPat), @@ -701,7 +701,7 @@ impl<'a, I: Tokens> Parser { // TODO: is BindingPat correct? self.reparse_expr_as_pat(pat_ty.element(), expr).map(Some)? } - // TODO: sytax error if last element is ellison and ...rest exists. + // TODO: syntax error if last element is ellison and ...rest exists. None => None, }; params.push(last); diff --git a/ecmascript/parser/src/token.rs b/ecmascript/parser/src/token.rs index 25f1408340d..269627435d1 100644 --- a/ecmascript/parser/src/token.rs +++ b/ecmascript/parser/src/token.rs @@ -1,6 +1,6 @@ //! Ported from [babel/bablyon][] //! -//! [babel/bablyon]:https://github.com/babel/babel/blob/2d378d076eb0c5fe63234a8b509886005c01d7ee/packages/babylon/src/tokenizer/types.js +//! [babel/babylon]:https://github.com/babel/babel/blob/2d378d076eb0c5fe63234a8b509886005c01d7ee/packages/babylon/src/tokenizer/types.js pub(crate) use self::{AssignOpToken::*, BinOpToken::*, Keyword::*, Token::*}; use crate::error::Error; use enum_kind::Kind; @@ -109,7 +109,7 @@ pub enum Token { #[kind(starts_expr)] Str { value: JsWord, - /// This field exsits because 'use\x20strict' is **not** an use strict + /// This field exists because 'use\x20strict' is **not** an use strict /// directive. has_escape: bool, }, diff --git a/ecmascript/parser/tests/test262-error-references/fail/14eaa7e71c682461.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/14eaa7e71c682461.js.stderr index aeb1ebf2726..d8ae16827aa 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/14eaa7e71c682461.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/14eaa7e71c682461.js.stderr @@ -1,4 +1,4 @@ -error: Invalid unciode code point +error: Invalid unicode code point --> $DIR/tests/test262-parser/fail/14eaa7e71c682461.js:1:6 | 1 | ("\u{FFFFFFF}") diff --git a/ecmascript/parser/tests/test262-error-references/fail/15ce7f870c38eaff.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/15ce7f870c38eaff.js.stderr index 7642a32b2c3..9c872fc6347 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/15ce7f870c38eaff.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/15ce7f870c38eaff.js.stderr @@ -1,4 +1,4 @@ -error: Parenthized expression cannot be empty +error: Parenthesized expression cannot be empty --> $DIR/tests/test262-parser/fail/15ce7f870c38eaff.js:1:1 | 1 | () ? 42 diff --git a/ecmascript/parser/tests/test262-error-references/fail/2687d6d9043bd5cb.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/2687d6d9043bd5cb.js.stderr index ac97db4ae41..98a089a5c92 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/2687d6d9043bd5cb.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/2687d6d9043bd5cb.js.stderr @@ -1,4 +1,4 @@ -error: Invalid unciode code point +error: Invalid unicode code point --> $DIR/tests/test262-parser/fail/2687d6d9043bd5cb.js:1:5 | 1 | "\u{}" diff --git a/ecmascript/parser/tests/test262-error-references/fail/27e55098f070e9ef.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/27e55098f070e9ef.js.stderr index 80be1b69f0d..5a1f7ccf0de 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/27e55098f070e9ef.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/27e55098f070e9ef.js.stderr @@ -1,4 +1,4 @@ -error: Invalid unciode escape +error: Invalid unicode escape --> $DIR/tests/test262-parser/fail/27e55098f070e9ef.js:1:2 | 1 | "\u{FFFF" diff --git a/ecmascript/parser/tests/test262-error-references/fail/41dc02fc2a2ab563.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/41dc02fc2a2ab563.js.stderr index c8ba0ea5b3e..09abb00bbfa 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/41dc02fc2a2ab563.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/41dc02fc2a2ab563.js.stderr @@ -1,4 +1,4 @@ -error: Parenthized expression cannot be empty +error: Parenthesized expression cannot be empty --> $DIR/tests/test262-parser/fail/41dc02fc2a2ab563.js:1:1 | 1 | () ? 0 diff --git a/ecmascript/parser/tests/test262-error-references/fail/54b72e05f42d7802.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/54b72e05f42d7802.js.stderr index 79f692894df..6e128091c15 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/54b72e05f42d7802.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/54b72e05f42d7802.js.stderr @@ -1,4 +1,4 @@ -error: Parenthized expression cannot be empty +error: Parenthesized expression cannot be empty --> $DIR/tests/test262-parser/fail/54b72e05f42d7802.js:1:5 | 1 | 1 + () diff --git a/ecmascript/parser/tests/test262-error-references/fail/665ab370012f20cf.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/665ab370012f20cf.js.stderr index 234e2429c8e..8bd59f977df 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/665ab370012f20cf.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/665ab370012f20cf.js.stderr @@ -1,4 +1,4 @@ -error: Declatation is now allowed +error: Declaration is now allowed --> $DIR/tests/test262-parser/fail/665ab370012f20cf.js:1:12 | 1 | with(true) function a(){} diff --git a/ecmascript/parser/tests/test262-error-references/fail/6cd36f7e68bdfb7a.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/6cd36f7e68bdfb7a.js.stderr index 1fa07a425db..7c63d82ccf3 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/6cd36f7e68bdfb7a.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/6cd36f7e68bdfb7a.js.stderr @@ -1,4 +1,4 @@ -error: Declatation is now allowed +error: Declaration is now allowed --> $DIR/tests/test262-parser/fail/6cd36f7e68bdfb7a.js:1:9 | 1 | for(;;) function a(){} diff --git a/ecmascript/parser/tests/test262-error-references/fail/971cf622ebaef28e.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/971cf622ebaef28e.js.stderr index c80f220ee02..eda489097e6 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/971cf622ebaef28e.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/971cf622ebaef28e.js.stderr @@ -1,4 +1,4 @@ -error: Declatation is now allowed +error: Declaration is now allowed --> $DIR/tests/test262-parser/fail/971cf622ebaef28e.js:1:12 | 1 | with(true) class a {} diff --git a/ecmascript/parser/tests/test262-error-references/fail/abe5f49acb8e132a.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/abe5f49acb8e132a.js.stderr index 394ba63b63d..01df41fe43b 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/abe5f49acb8e132a.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/abe5f49acb8e132a.js.stderr @@ -1,4 +1,4 @@ -error: Invalid unciode escape +error: Invalid unicode escape --> $DIR/tests/test262-parser/fail/abe5f49acb8e132a.js:1:2 | 1 | "\u{FFZ}" diff --git a/ecmascript/parser/tests/test262-error-references/fail/aca911e336954a5b.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/aca911e336954a5b.js.stderr index f597c0bd7f3..e3aefa0167f 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/aca911e336954a5b.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/aca911e336954a5b.js.stderr @@ -1,4 +1,4 @@ -error: Invalid unciode code point +error: Invalid unicode code point --> $DIR/tests/test262-parser/fail/aca911e336954a5b.js:1:6 | 1 | ("\u{110000}") diff --git a/ecmascript/parser/tests/test262-error-references/fail/c7ad2478fd72bffe.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/c7ad2478fd72bffe.js.stderr index c5f21874fa1..7e55bf87daa 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/c7ad2478fd72bffe.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/c7ad2478fd72bffe.js.stderr @@ -1,4 +1,4 @@ -error: Declatation is now allowed +error: Declaration is now allowed --> $DIR/tests/test262-parser/fail/c7ad2478fd72bffe.js:1:13 | 1 | for(a in b) function c(){} diff --git a/ecmascript/parser/tests/test262-error-references/fail/e808e347646c2670.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/e808e347646c2670.js.stderr index c4c600300c5..c905d615562 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/e808e347646c2670.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/e808e347646c2670.js.stderr @@ -1,4 +1,4 @@ -error: Declatation is now allowed +error: Declaration is now allowed --> $DIR/tests/test262-parser/fail/e808e347646c2670.js:1:13 | 1 | for(a of b) function c(){} diff --git a/ecmascript/parser/tests/test262-error-references/fail/efcb54b62e8f0e06.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/efcb54b62e8f0e06.js.stderr index f9a234f9c7a..5977fda9005 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/efcb54b62e8f0e06.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/efcb54b62e8f0e06.js.stderr @@ -1,4 +1,4 @@ -error: Declatation is now allowed +error: Declaration is now allowed --> $DIR/tests/test262-parser/fail/efcb54b62e8f0e06.js:1:11 | 1 | while (1) function foo(){} diff --git a/ecmascript/parser/tests/test262-error-references/fail/f2db53245b89c72f.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/f2db53245b89c72f.js.stderr index 9816a5f24c3..79a6894ce43 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/f2db53245b89c72f.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/f2db53245b89c72f.js.stderr @@ -1,4 +1,4 @@ -error: Declatation is now allowed +error: Declaration is now allowed --> $DIR/tests/test262-parser/fail/f2db53245b89c72f.js:1:13 | 1 | while(true) function a(){} diff --git a/ecmascript/parser/tests/test262-error-references/fail/f8b20220d8c85d71.js.stderr b/ecmascript/parser/tests/test262-error-references/fail/f8b20220d8c85d71.js.stderr index c913c9c41e0..70d541004f0 100644 --- a/ecmascript/parser/tests/test262-error-references/fail/f8b20220d8c85d71.js.stderr +++ b/ecmascript/parser/tests/test262-error-references/fail/f8b20220d8c85d71.js.stderr @@ -1,4 +1,4 @@ -error: Invalid unciode code point +error: Invalid unicode code point --> $DIR/tests/test262-parser/fail/f8b20220d8c85d71.js:1:5 | 1 | "\u{110000}" diff --git a/ecmascript/preset_env/Cargo.toml b/ecmascript/preset_env/Cargo.toml index a575db25ada..1bb87a171a4 100644 --- a/ecmascript/preset_env/Cargo.toml +++ b/ecmascript/preset_env/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://swc.rs/rustdoc/swc_ecma_preset_env/" edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_preset_env" -version = "0.7.0" +version = "0.7.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,17 +17,17 @@ semver = {version = "0.9.0", features = ["serde"]} serde = {version = "1", features = ["derive"]} serde_json = "1" st-map = "0.1.2" -string_enum = {version = "0.3", path = "../../macros/string_enum"} +string_enum = {version = "0.3.1", path = "../../macros/string_enum"} swc_atoms = {version = "0.2", path = "../../atoms"} -swc_common = {version = "0.10", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_transforms = {version = "0.37.0", path = "../transforms", features = ["compat", "proposal"]} -swc_ecma_utils = {version = "0.29.0", path = "../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../visit"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_transforms = {version = "0.37.1", path = "../transforms", features = ["compat", "proposal"]} +swc_ecma_utils = {version = "0.29.1", path = "../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../visit"} walkdir = "2" [dev-dependencies] pretty_assertions = "0.6" -swc_ecma_codegen = {version = "0.46.0", path = "../codegen"} -swc_ecma_parser = {version = "0.48.0", path = "../parser"} -testing = {version = "0.10", path = "../../testing"} +swc_ecma_codegen = {version = "0.46.1", path = "../codegen"} +swc_ecma_parser = {version = "0.48.1", path = "../parser"} +testing = {version = "0.10.3", path = "../../testing"} diff --git a/ecmascript/transforms/Cargo.toml b/ecmascript/transforms/Cargo.toml index 186047e12ee..54d05b03849 100644 --- a/ecmascript/transforms/Cargo.toml +++ b/ecmascript/transforms/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms" repository = "https://github.com/swc-project/swc.git" -version = "0.37.0" +version = "0.37.1" [features] compat = ["swc_ecma_transforms_compat"] @@ -18,25 +18,25 @@ typescript = ["swc_ecma_transforms_typescript"] [dependencies] swc_atoms = {version = "0.2.0", path = "../../atoms"} -swc_common = {version = "0.10.0", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../parser"} -swc_ecma_transforms_base = {version = "0.5.0", path = "./base"} -swc_ecma_transforms_compat = {version = "0.6.0", path = "./compat", optional = true} -swc_ecma_transforms_module = {version = "0.6.0", path = "./module", optional = true} -swc_ecma_transforms_optimization = {version = "0.7.0", path = "./optimization", optional = true} -swc_ecma_transforms_proposal = {version = "0.6.0", path = "./proposal", optional = true} -swc_ecma_transforms_react = {version = "0.7.0", path = "./react", optional = true} -swc_ecma_transforms_typescript = {version = "0.6.0", path = "./typescript", optional = true} -swc_ecma_utils = {version = "0.29.0", path = "../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../visit"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../parser"} +swc_ecma_transforms_base = {version = "0.5.2", path = "./base"} +swc_ecma_transforms_compat = {version = "0.6.1", path = "./compat", optional = true} +swc_ecma_transforms_module = {version = "0.6.1", path = "./module", optional = true} +swc_ecma_transforms_optimization = {version = "0.7.1", path = "./optimization", optional = true} +swc_ecma_transforms_proposal = {version = "0.6.1", path = "./proposal", optional = true} +swc_ecma_transforms_react = {version = "0.7.1", path = "./react", optional = true} +swc_ecma_transforms_typescript = {version = "0.6.1", path = "./typescript", optional = true} +swc_ecma_utils = {version = "0.29.1", path = "../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] pretty_assertions = "0.6" sourcemap = "6" -swc_ecma_codegen = {version = "0.46.0", path = "../codegen"} -swc_ecma_transforms_testing = {version = "0.5.0", path = "./testing"} +swc_ecma_codegen = {version = "0.46.1", path = "../codegen"} +swc_ecma_transforms_testing = {version = "0.5.1", path = "./testing"} tempfile = "3" -testing = {version = "0.10.0", path = "../../testing"} +testing = {version = "0.10.3", path = "../../testing"} walkdir = "2" diff --git a/ecmascript/transforms/base/Cargo.toml b/ecmascript/transforms/base/Cargo.toml index 1c94075f8f4..e6025f499e9 100644 --- a/ecmascript/transforms/base/Cargo.toml +++ b/ecmascript/transforms/base/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_base" repository = "https://github.com/swc-project/swc.git" -version = "0.5.1" +version = "0.5.2" [dependencies] fxhash = "0.2.1" @@ -15,12 +15,12 @@ phf = {version = "0.8.0", features = ["macros"]} scoped-tls = "1.0.0" smallvec = "1.6.0" swc_atoms = {version = "0.2", path = "../../../atoms"} -swc_common = {version = "0.10", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} [dev-dependencies] -swc_ecma_codegen = {version = "0.46.0", path = "../../codegen"} -testing = {version = "0.10", path = "../../../testing"} +swc_ecma_codegen = {version = "0.46.1", path = "../../codegen"} +testing = {version = "0.10.3", path = "../../../testing"} diff --git a/ecmascript/transforms/base/src/hygiene/mod.rs b/ecmascript/transforms/base/src/hygiene/mod.rs index 3e45e883c61..ffed493ed5c 100644 --- a/ecmascript/transforms/base/src/hygiene/mod.rs +++ b/ecmascript/transforms/base/src/hygiene/mod.rs @@ -137,7 +137,7 @@ impl<'a> Hygiene<'a> { { // This assertion was correct in old time, but bundler creates // same variable with same name and same span - // hygieen, so this assertion is not valid anymore. + // hygiene, so this assertion is not valid anymore. // // I decided not to remove this code because I may modify the // bundler to be correct in aspect of original span hygiene. @@ -631,7 +631,7 @@ impl<'a> VisitMut for Hygiene<'a> { fn visit_mut_private_name(&mut self, _: &mut PrivateName) {} - /// Invoked for `IdetifierRefrence` / `BindingIdentifier` + /// Invoked for `IdentifierReference` / `BindingIdentifier` fn visit_mut_ident(&mut self, i: &mut Ident) { if i.sym == js_word!("arguments") || i.sym == js_word!("undefined") { return; diff --git a/ecmascript/transforms/base/src/lib.rs b/ecmascript/transforms/base/src/lib.rs index 62289c1fc59..46407786981 100644 --- a/ecmascript/transforms/base/src/lib.rs +++ b/ecmascript/transforms/base/src/lib.rs @@ -1,6 +1,6 @@ #![deny(unused)] -#[doc(hideen)] +#[doc(hidden)] pub mod ext; pub mod fixer; #[macro_use] diff --git a/ecmascript/transforms/base/src/native.rs b/ecmascript/transforms/base/src/native.rs index 5335246a80c..76b3fa7e695 100644 --- a/ecmascript/transforms/base/src/native.rs +++ b/ecmascript/transforms/base/src/native.rs @@ -1,4 +1,4 @@ -//! Module to check if an identifier is natvie word. +//! Module to check if an identifier is native word. use phf::phf_set; use swc_atoms::{js_word, JsWord}; diff --git a/ecmascript/transforms/base/src/resolver/mod.rs b/ecmascript/transforms/base/src/resolver/mod.rs index 63dc661ba40..86768327e57 100644 --- a/ecmascript/transforms/base/src/resolver/mod.rs +++ b/ecmascript/transforms/base/src/resolver/mod.rs @@ -35,7 +35,7 @@ pub fn resolver() -> impl 'static + Fold { /// /// `top_level_mark` should not be root. /// -/// # Exmaple +/// # Example /// /// ```js /// let a = 1; diff --git a/ecmascript/transforms/base/src/resolver/tests.rs b/ecmascript/transforms/base/src/resolver/tests.rs index 163b53b73f3..99fddfa4fc6 100644 --- a/ecmascript/transforms/base/src/resolver/tests.rs +++ b/ecmascript/transforms/base/src/resolver/tests.rs @@ -1262,7 +1262,7 @@ class Foo { ); to_ts!( - ts_resolver_neseted_interface, + ts_resolver_nested_interface, " interface Foo { name: string @@ -1328,7 +1328,7 @@ const bar = {} as Foo; ); to_ts!( - ts_resolver_neseted_type_alias, + ts_resolver_nested_type_alias, " type Foo = {}; diff --git a/ecmascript/transforms/base/tests/fixer_test262.rs b/ecmascript/transforms/base/tests/fixer_test262.rs index d0514e4549c..c8027275c2c 100644 --- a/ecmascript/transforms/base/tests/fixer_test262.rs +++ b/ecmascript/transforms/base/tests/fixer_test262.rs @@ -19,7 +19,7 @@ use test::{ }; const IGNORED_PASS_TESTS: &[&str] = &[ - // TODO: uningnore + // TODO: unignore "5654d4106d7025c2.js", "431ecef8c85d4d24.js", // Stack size (Stupid parens) @@ -262,7 +262,7 @@ fn identity_tests(tests: &mut Vec) -> Result<(), io::Error> { fn identity() { let args: Vec<_> = env::args().collect(); let mut tests = Vec::new(); - identity_tests(&mut tests).expect("failed to load testss"); + identity_tests(&mut tests).expect("failed to load tests"); test_main(&args, tests, Some(Options::new())); } diff --git a/ecmascript/transforms/compat/Cargo.toml b/ecmascript/transforms/compat/Cargo.toml index 9f5cc63f8b4..3179f98efc4 100644 --- a/ecmascript/transforms/compat/Cargo.toml +++ b/ecmascript/transforms/compat/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_compat" repository = "https://github.com/swc-project/swc.git" -version = "0.6.0" +version = "0.6.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -19,14 +19,14 @@ ordered-float = "2.0.1" serde = {version = "1.0.118", features = ["derive"]} smallvec = "1.6.0" swc_atoms = {version = "0.2.5", path = "../../../atoms"} -swc_common = {version = "0.10.8", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_transforms_base = {version = "0.5.0", path = "../base"} -swc_ecma_transforms_macros = {version = "0.2.0", path = "../macros"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_transforms_base = {version = "0.5.2", path = "../base"} +swc_ecma_transforms_macros = {version = "0.2.1", path = "../macros"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} [dev-dependencies] -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_transforms_testing = {version = "0.5.0", path = "../testing"} -testing = {version = "0.10.2", path = "../../../testing"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_transforms_testing = {version = "0.5.1", path = "../testing"} +testing = {version = "0.10.3", path = "../../../testing"} diff --git a/ecmascript/transforms/compat/src/es2015/block_scoping.rs b/ecmascript/transforms/compat/src/es2015/block_scoping.rs index af7c3e319b0..d882da03a64 100644 --- a/ecmascript/transforms/compat/src/es2015/block_scoping.rs +++ b/ecmascript/transforms/compat/src/es2015/block_scoping.rs @@ -184,7 +184,7 @@ impl BlockScoping { }) .unwrap_or(true) { - body.stmts.push(v.make_reassignemnt(None).into_stmt()); + body.stmts.push(v.make_reassignment(None).into_stmt()); } } } @@ -855,7 +855,7 @@ struct MutationHandler<'a> { } impl MutationHandler<'_> { - fn make_reassignemnt(&self, orig: Option>) -> Expr { + fn make_reassignment(&self, orig: Option>) -> Expr { if self.map.is_empty() { return *orig.unwrap_or_else(|| undefined(DUMMY_SP)); } @@ -934,7 +934,7 @@ impl VisitMut for MutationHandler<'_> { let val = n.arg.take(); - n.arg = Some(Box::new(self.make_reassignemnt(val))) + n.arg = Some(Box::new(self.make_reassignment(val))) } } diff --git a/ecmascript/transforms/compat/src/es2015/classes.rs b/ecmascript/transforms/compat/src/es2015/classes.rs index 7951917274a..4484df84bb7 100644 --- a/ecmascript/transforms/compat/src/es2015/classes.rs +++ b/ecmascript/transforms/compat/src/es2015/classes.rs @@ -241,7 +241,7 @@ impl Classes { } } - /// Turns class expresion into iife. + /// Turns class expression into iife. /// /// ```js /// class Foo {} diff --git a/ecmascript/transforms/compat/src/es2015/classes/constructor.rs b/ecmascript/transforms/compat/src/es2015/classes/constructor.rs index dfd9a1d971e..39b5adb91e4 100644 --- a/ecmascript/transforms/compat/src/es2015/classes/constructor.rs +++ b/ecmascript/transforms/compat/src/es2015/classes/constructor.rs @@ -11,7 +11,7 @@ use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith}; pub(super) struct SuperCallFinder { mode: Option, - /// True in conditional statement or arrow expresion. + /// True in conditional statement or arrow expression. in_complex: bool, } @@ -103,7 +103,7 @@ impl Visit for SuperCallFinder { /// Don't recurse into class declaration. fn visit_class(&mut self, _: &Class, _: &dyn Node) {} - /// Don't recurse into funcrion. + /// Don't recurse into function. fn visit_function(&mut self, _: &Function, _: &dyn Node) {} fn visit_member_expr(&mut self, e: &MemberExpr, _: &dyn Node) { diff --git a/ecmascript/transforms/compat/src/es2015/destructuring.rs b/ecmascript/transforms/compat/src/es2015/destructuring.rs index dd949bd626c..8f2e5377861 100644 --- a/ecmascript/transforms/compat/src/es2015/destructuring.rs +++ b/ecmascript/transforms/compat/src/es2015/destructuring.rs @@ -413,7 +413,7 @@ impl AssignFolder { }) => { assert!( decl.init.is_some(), - "desturcturing pattern binding requires initializer" + "destructuring pattern binding requires initializer" ); let init = decl.init; @@ -862,7 +862,7 @@ impl Destructuring { T: StmtLike + VisitWith + FoldWith, { // fast path - if !has_destruturing(&stmts) { + if !has_destructuring(&stmts) { return stmts; } @@ -1098,7 +1098,7 @@ fn can_be_null(e: &Expr) -> bool { } } -fn has_destruturing(node: &N) -> bool +fn has_destructuring(node: &N) -> bool where N: VisitWith, { diff --git a/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs b/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs index 69d2759f466..d135273892f 100644 --- a/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs +++ b/ecmascript/transforms/compat/src/es2015/regenerator/mod.rs @@ -31,7 +31,7 @@ struct Regenerator { global_mark: Mark, /// [Some] if used. regenerator_runtime: Option, - /// Variables delcared in outer function. + /// Variables declared in outer function. outer_fn_vars: Vec, /// mark top_level_vars: Vec, diff --git a/ecmascript/transforms/compat/src/es2015/spread.rs b/ecmascript/transforms/compat/src/es2015/spread.rs index 19fa427ecc3..2a12d19302b 100644 --- a/ecmascript/transforms/compat/src/es2015/spread.rs +++ b/ecmascript/transforms/compat/src/es2015/spread.rs @@ -144,8 +144,9 @@ impl Fold for ActualFolder { self.vars.push(VarDeclarator { span: DUMMY_SP, definite: false, + // Initialized by paren expression. name: Pat::Ident(ident.clone().into()), - // Initialized by paren exprssion. + // Initialized by paren expression. init: None, }); diff --git a/ecmascript/transforms/compat/src/es2020/class_properties.rs b/ecmascript/transforms/compat/src/es2020/class_properties.rs index 76c2d3deb6b..0a401596cce 100644 --- a/ecmascript/transforms/compat/src/es2020/class_properties.rs +++ b/ecmascript/transforms/compat/src/es2020/class_properties.rs @@ -32,7 +32,7 @@ mod used_name; /// /// # Impl note /// -/// We use custom helper to handle export defaul class +/// We use custom helper to handle export default class pub fn class_properties() -> impl Fold { ClassProperties { typescript: false, diff --git a/ecmascript/transforms/macros/Cargo.toml b/ecmascript/transforms/macros/Cargo.toml index e794681845c..46773422864 100644 --- a/ecmascript/transforms/macros/Cargo.toml +++ b/ecmascript/transforms/macros/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_macros" repository = "https://github.com/swc-project/swc.git" -version = "0.2.0" +version = "0.2.1" [lib] proc-macro = true @@ -15,5 +15,5 @@ proc-macro = true pmutil = "0.5.1" proc-macro2 = "1" quote = "1" -swc_macros_common = {version = "0.3", path = "../../../macros/common"} +swc_macros_common = {version = "0.3.2", path = "../../../macros/common"} syn = {version = "1", features = ["fold", "parsing", "full"]} diff --git a/ecmascript/transforms/module/Cargo.toml b/ecmascript/transforms/module/Cargo.toml index 05583748597..2580405de8b 100644 --- a/ecmascript/transforms/module/Cargo.toml +++ b/ecmascript/transforms/module/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_module" repository = "https://github.com/swc-project/swc.git" -version = "0.6.0" +version = "0.6.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -15,14 +15,14 @@ fxhash = "0.2.1" indexmap = "1.6.1" serde = {version = "1.0.118", features = ["derive"]} swc_atoms = {version = "0.2", path = "../../../atoms"} -swc_common = {version = "0.10", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.5.0", path = "../base"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.5.2", path = "../base"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.6.0", path = "../compat"} -swc_ecma_transforms_testing = {version = "0.5.0", path = "../testing/"} -testing = {version = "0.10", path = "../../../testing/"} +swc_ecma_transforms_compat = {version = "0.6.1", path = "../compat"} +swc_ecma_transforms_testing = {version = "0.5.1", path = "../testing/"} +testing = {version = "0.10.3", path = "../../../testing/"} diff --git a/ecmascript/transforms/module/src/amd.rs b/ecmascript/transforms/module/src/amd.rs index 8e79df140c1..d9a6ea48161 100644 --- a/ecmascript/transforms/module/src/amd.rs +++ b/ecmascript/transforms/module/src/amd.rs @@ -273,7 +273,7 @@ impl Fold for Amd { ModuleDecl::ExportDefaultExpr(ExportDefaultExpr { expr, .. }) => { let ident = private_ident!("_default"); - // We use extra statements because of the initialzation + // We use extra statements because of the initialization extra_stmts.push(Stmt::Decl(Decl::Var(VarDecl { span: DUMMY_SP, kind: VarDeclKind::Var, diff --git a/ecmascript/transforms/module/src/common_js.rs b/ecmascript/transforms/module/src/common_js.rs index 7aecb75ca18..948c612efbd 100644 --- a/ecmascript/transforms/module/src/common_js.rs +++ b/ecmascript/transforms/module/src/common_js.rs @@ -278,7 +278,7 @@ impl Fold for CommonJs { // TODO: Optimization (when expr cannot throw, `exports.default = // void 0` is not required) - // We use extra statements because of the initialzation + // We use extra statements because of the initialization extra_stmts.push(ModuleItem::Stmt(Stmt::Decl(Decl::Var(VarDecl { span: DUMMY_SP, kind: VarDeclKind::Var, diff --git a/ecmascript/transforms/module/src/umd.rs b/ecmascript/transforms/module/src/umd.rs index 40c4891bc4a..33d95102524 100644 --- a/ecmascript/transforms/module/src/umd.rs +++ b/ecmascript/transforms/module/src/umd.rs @@ -266,7 +266,7 @@ impl Fold for Umd { ModuleDecl::ExportDefaultExpr(expr) => { let ident = private_ident!("_default"); - // We use extra statements because of the initialzation + // We use extra statements because of the initialization extra_stmts.push(Stmt::Decl(Decl::Var(VarDecl { span: DUMMY_SP, kind: VarDeclKind::Var, diff --git a/ecmascript/transforms/module/src/util.rs b/ecmascript/transforms/module/src/util.rs index 18a39f4380a..56a6eb622d8 100644 --- a/ecmascript/transforms/module/src/util.rs +++ b/ecmascript/transforms/module/src/util.rs @@ -248,7 +248,7 @@ impl Scope { .into_stmt() } - /// Import src to export fomr it. + /// Import src to export from it. pub fn import_to_export(&mut self, src: &Str, init: bool) -> Option { let entry = self .imports diff --git a/ecmascript/transforms/module/tests/common_js.rs b/ecmascript/transforms/module/tests/common_js.rs index 2afb7c74f7e..bc8ec881a41 100644 --- a/ecmascript/transforms/module/tests/common_js.rs +++ b/ecmascript/transforms/module/tests/common_js.rs @@ -2467,7 +2467,7 @@ function diff() { // interop_module_shadow test!( - // TODO(kdy1): Uningnore this + // TODO(kdy1): Unignore this ignore, syntax(), |_| tr(Config { diff --git a/ecmascript/transforms/optimization/Cargo.toml b/ecmascript/transforms/optimization/Cargo.toml index 10bceccb0ac..6b9a86e119d 100644 --- a/ecmascript/transforms/optimization/Cargo.toml +++ b/ecmascript/transforms/optimization/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_optimization" repository = "https://github.com/swc-project/swc.git" -version = "0.7.0" +version = "0.7.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -18,17 +18,17 @@ once_cell = "1.5.2" retain_mut = "0.1.2" serde_json = "1.0.61" swc_atoms = {version = "0.2", path = "../../../atoms"} -swc_common = {version = "0.10", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.5.0", path = "../base"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.5.2", path = "../base"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.6.0", path = "../compat"} -swc_ecma_transforms_module = {version = "0.6.0", path = "../module"} -swc_ecma_transforms_proposal = {version = "0.6.0", path = "../proposal"} -swc_ecma_transforms_react = {version = "0.7.0", path = "../react"} -swc_ecma_transforms_testing = {version = "0.5.0", path = "../testing"} -swc_ecma_transforms_typescript = {version = "0.6.0", path = "../typescript"} +swc_ecma_transforms_compat = {version = "0.6.1", path = "../compat"} +swc_ecma_transforms_module = {version = "0.6.1", path = "../module"} +swc_ecma_transforms_proposal = {version = "0.6.1", path = "../proposal"} +swc_ecma_transforms_react = {version = "0.7.1", path = "../react"} +swc_ecma_transforms_testing = {version = "0.5.1", path = "../testing"} +swc_ecma_transforms_typescript = {version = "0.6.1", path = "../typescript"} diff --git a/ecmascript/transforms/optimization/src/const_modules.rs b/ecmascript/transforms/optimization/src/const_modules.rs index 8a24dd6f858..bd2a3394971 100644 --- a/ecmascript/transforms/optimization/src/const_modules.rs +++ b/ecmascript/transforms/optimization/src/const_modules.rs @@ -57,7 +57,7 @@ fn parse_option(cm: &SourceMap, name: &str, src: String) -> Arc { .map(drop_span) .unwrap_or_else(|()| { panic!( - "faield to parse jsx option {}: '{}' is not an expression", + "failed to parse jsx option {}: '{}' is not an expression", name, fm.src, ) }); diff --git a/ecmascript/transforms/optimization/src/json_parse.rs b/ecmascript/transforms/optimization/src/json_parse.rs index 83eaec74a54..e1561c96526 100644 --- a/ecmascript/transforms/optimization/src/json_parse.rs +++ b/ecmascript/transforms/optimization/src/json_parse.rs @@ -6,7 +6,7 @@ use swc_ecma_utils::member_expr; use swc_ecma_utils::{calc_literal_cost, ExprFactory}; use swc_ecma_visit::{noop_fold_type, Fold, FoldWith}; -/// Trnasform to optimize performance of literals. +/// Transform to optimize performance of literals. /// /// /// This transform converts pure object literals like diff --git a/ecmascript/transforms/optimization/src/simplify/branch/tests.rs b/ecmascript/transforms/optimization/src/simplify/branch/tests.rs index 410af25a861..01d498eb663 100644 --- a/ecmascript/transforms/optimization/src/simplify/branch/tests.rs +++ b/ecmascript/transforms/optimization/src/simplify/branch/tests.rs @@ -1340,7 +1340,7 @@ fn test_object_literal() { test("({a:1})", ""); test("({a:foo()})", "foo()"); test("({'a':foo()})", "foo()"); - // Object-spread may tigger getters. + // Object-spread may trigger getters. test_same("({...a})"); test_same("({...foo()})"); } diff --git a/ecmascript/transforms/optimization/src/simplify/const_propgation.rs b/ecmascript/transforms/optimization/src/simplify/const_propgation.rs index 83e5eac8144..0a0212704a3 100644 --- a/ecmascript/transforms/optimization/src/simplify/const_propgation.rs +++ b/ecmascript/transforms/optimization/src/simplify/const_propgation.rs @@ -40,9 +40,9 @@ impl<'a> Scope<'a> { impl VisitMut for ConstPropagation<'_> { noop_visit_mut_type!(); - /// Altough span hygiene is magic, bundler creates invalid code in aspect of - /// span hygiene. (The bundled code can have two variables with identical - /// name with each other, with respect to span hygiene.) + /// Although span hygiene is magic, bundler creates invalid code in aspect + /// of span hygiene. (The bundled code can have two variables with + /// identical name with each other, with respect to span hygiene.) /// /// We avoid bugs caused by the bundler's wrong behavior by /// scoping variables. diff --git a/ecmascript/transforms/optimization/src/simplify/dce/mod.rs b/ecmascript/transforms/optimization/src/simplify/dce/mod.rs index c143a9a2a7f..ea20812edbc 100644 --- a/ecmascript/transforms/optimization/src/simplify/dce/mod.rs +++ b/ecmascript/transforms/optimization/src/simplify/dce/mod.rs @@ -147,15 +147,15 @@ macro_rules! normal { ( $name:ident, $T:ty, - $($singluar_props:ident),* + $($singular_props:ident),* ) => { - normal!($name, $T, [$($singluar_props),*], []); + normal!($name, $T, [$($singular_props),*], []); }; ( $name:ident, $T:ty, - [$($singluar_props:ident),*], + [$($singular_props:ident),*], [$($array_like_props:ident),*] ) => { fn $name(&mut self, node: &mut $T) { @@ -166,7 +166,7 @@ macro_rules! normal { } $( - node.$singluar_props.visit_mut_with(self); + node.$singular_props.visit_mut_with(self); )* $( @@ -175,7 +175,7 @@ macro_rules! normal { if self.marking_phase $( - || self.is_marked(node.$singluar_props.span()) + || self.is_marked(node.$singular_props.span()) )* $( || self.has_marked_elem(&node.$array_like_props) @@ -185,7 +185,7 @@ macro_rules! normal { node.span = node.span.apply_mark(self.config.used_mark); $( - self.mark(&mut node.$singluar_props); + self.mark(&mut node.$singular_props); )* $( @@ -743,7 +743,7 @@ impl VisitMut for Dce<'_> { // fn visit_mut_spread_element(&mut self, n: &mut SpreadElement) {} // ---- ---- ----- ---- ----- - // If an ast node delagates Spanned::span to a field, we don't need to handle it + // If an ast node delegates Spanned::span to a field, we don't need to handle it // because of the way Spanned::span works. // normal!(visit_mut_class_expr, ClassExpr, ident, class); diff --git a/ecmascript/transforms/optimization/src/simplify/expr/tests.rs b/ecmascript/transforms/optimization/src/simplify/expr/tests.rs index 63fecbac720..d6afd272467 100644 --- a/ecmascript/transforms/optimization/src/simplify/expr/tests.rs +++ b/ecmascript/transforms/optimization/src/simplify/expr/tests.rs @@ -1438,7 +1438,7 @@ fn test_fold_object_literal_ref1() { fold_same("var y = Symbol(); var a = {[y]: 3}[y];"); fold("var x = {a() { 1; }}.a;", "var x = function() { 1; };"); - // Notice `a` isn't invoked, so beahviour didn't change. + // Notice `a` isn't invoked, so behavior didn't change. fold( "var x = {a() { return this; }}.a;", "var x = function() { return this; };", diff --git a/ecmascript/transforms/proposal/Cargo.toml b/ecmascript/transforms/proposal/Cargo.toml index 4d1a04763c0..8a0220cb563 100644 --- a/ecmascript/transforms/proposal/Cargo.toml +++ b/ecmascript/transforms/proposal/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_proposal" repository = "https://github.com/swc-project/swc.git" -version = "0.6.0" +version = "0.6.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -16,14 +16,14 @@ fxhash = "0.2.1" serde = {version = "1.0.118", features = ["derive"]} smallvec = "1.6.0" swc_atoms = {version = "0.2", path = "../../../atoms"} -swc_common = {version = "0.10", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.5.0", path = "../base"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.5.2", path = "../base"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.6.0", path = "../compat"} -swc_ecma_transforms_module = {version = "0.6.0", path = "../module"} -swc_ecma_transforms_testing = {version = "0.5.0", path = "../testing"} +swc_ecma_transforms_compat = {version = "0.6.1", path = "../compat"} +swc_ecma_transforms_module = {version = "0.6.1", path = "../module"} +swc_ecma_transforms_testing = {version = "0.5.1", path = "../testing"} diff --git a/ecmascript/transforms/proposal/src/decorators/legacy.rs b/ecmascript/transforms/proposal/src/decorators/legacy.rs index 570cd063d75..1bbbd9aaf3c 100644 --- a/ecmascript/transforms/proposal/src/decorators/legacy.rs +++ b/ecmascript/transforms/proposal/src/decorators/legacy.rs @@ -809,7 +809,7 @@ impl Legacy { type_args: None, })); - // _class = dec(_class = funciton() {}) || _class + // _class = dec(_class = function() {}) || _class let class_expr = Box::new(Expr::Assign(AssignExpr { span: DUMMY_SP, left: PatOrExpr::Pat(Box::new(Pat::Ident(class_ident.clone().into()))), diff --git a/ecmascript/transforms/react/Cargo.toml b/ecmascript/transforms/react/Cargo.toml index 37d1e451334..bccc5a2178f 100644 --- a/ecmascript/transforms/react/Cargo.toml +++ b/ecmascript/transforms/react/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0/MIT" name = "swc_ecma_transforms_react" repository = "https://github.com/swc-project/swc.git" -version = "0.7.0" +version = "0.7.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -15,17 +15,17 @@ dashmap = "4.0.1" once_cell = "1.5.2" regex = "1.4.2" serde = {version = "1.0.118", features = ["derive"]} -string_enum = {version = "0.3", path = "../../../macros/string_enum"} +string_enum = {version = "0.3.1", path = "../../../macros/string_enum"} swc_atoms = {version = "0.2", path = "../../../atoms"} -swc_common = {version = "0.10", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.5.0", path = "../base"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.5.2", path = "../base"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.6.0", path = "../compat/"} -swc_ecma_transforms_module = {version = "0.6.0", path = "../module"} -swc_ecma_transforms_testing = {version = "0.5.0", path = "../testing/"} -testing = {version = "0.10.2", path = "../../../testing"} +swc_ecma_transforms_compat = {version = "0.6.1", path = "../compat/"} +swc_ecma_transforms_module = {version = "0.6.1", path = "../module"} +swc_ecma_transforms_testing = {version = "0.5.1", path = "../testing/"} +testing = {version = "0.10.3", path = "../../../testing"} diff --git a/ecmascript/transforms/react/src/display_name/mod.rs b/ecmascript/transforms/react/src/display_name/mod.rs index 77584b0631b..fa4e61a6743 100644 --- a/ecmascript/transforms/react/src/display_name/mod.rs +++ b/ecmascript/transforms/react/src/display_name/mod.rs @@ -236,6 +236,6 @@ fn is_key_display_name(prop: &PropOrSpread) -> bool { Prop::Assign(..) => unreachable!("invalid syntax"), }, _ => false, - // TODO(kdy1): maybe.. handle spead + // TODO(kdy1): maybe.. handle spread } } diff --git a/ecmascript/transforms/react/src/jsx/mod.rs b/ecmascript/transforms/react/src/jsx/mod.rs index 9c1691a62ee..90af1c90613 100644 --- a/ecmascript/transforms/react/src/jsx/mod.rs +++ b/ecmascript/transforms/react/src/jsx/mod.rs @@ -135,7 +135,7 @@ fn parse_classic_option(cm: &SourceMap, name: &str, src: String) -> Box { .map(drop_span) .unwrap_or_else(|()| { panic!( - "faield to parse jsx option {}: '{}' is not an expression", + "failed to parse jsx option {}: '{}' is not an expression", name, fm.src, ) }); @@ -537,6 +537,9 @@ where }); return None; } + JSXElementChild::JSXSpreadChild(JSXSpreadChild { .. }) => { + unimplemented!("jsx spread child") + } }) } diff --git a/ecmascript/transforms/testing/Cargo.toml b/ecmascript/transforms/testing/Cargo.toml index 0c85d79e26a..c85beeba78f 100644 --- a/ecmascript/transforms/testing/Cargo.toml +++ b/ecmascript/transforms/testing/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_testing" repository = "https://github.com/swc-project/swc.git" -version = "0.5.0" +version = "0.5.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -14,12 +14,12 @@ version = "0.5.0" ansi_term = "0.12.1" serde = "1" serde_json = "1" -swc_common = {version = "0.10", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_codegen = {version = "0.46.0", path = "../../codegen"} -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.5.0", path = "../base"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_codegen = {version = "0.46.1", path = "../../codegen"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.5.2", path = "../base"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} tempfile = "3.1.0" -testing = {version = "0.10.2", path = "../../../testing"} +testing = {version = "0.10.3", path = "../../../testing"} diff --git a/ecmascript/transforms/typescript/Cargo.toml b/ecmascript/transforms/typescript/Cargo.toml index f588f6dce45..d3bc34533d2 100644 --- a/ecmascript/transforms/typescript/Cargo.toml +++ b/ecmascript/transforms/typescript/Cargo.toml @@ -6,25 +6,25 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_typescript" repository = "https://github.com/swc-project/swc.git" -version = "0.6.0" +version = "0.6.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] fxhash = "0.2.1" serde = {version = "1.0.118", features = ["derive"]} swc_atoms = {version = "0.2", path = "../../../atoms"} -swc_common = {version = "0.10.9", path = "../../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../../ast"} -swc_ecma_parser = {version = "0.48.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.5.0", path = "../base"} -swc_ecma_utils = {version = "0.29.0", path = "../../utils"} -swc_ecma_visit = {version = "0.25.0", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../../ast"} +swc_ecma_parser = {version = "0.48.1", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.5.2", path = "../base"} +swc_ecma_utils = {version = "0.29.1", path = "../../utils"} +swc_ecma_visit = {version = "0.25.1", path = "../../visit"} [dev-dependencies] -swc_ecma_codegen = {version = "0.46.0", path = "../../codegen"} -swc_ecma_transforms_compat = {version = "0.6.0", path = "../compat"} -swc_ecma_transforms_module = {version = "0.6.0", path = "../module"} -swc_ecma_transforms_proposal = {version = "0.6.0", path = "../proposal/"} -swc_ecma_transforms_testing = {version = "0.5.0", path = "../testing"} -testing = {version = "0.10.2", path = "../../../testing"} +swc_ecma_codegen = {version = "0.46.1", path = "../../codegen"} +swc_ecma_transforms_compat = {version = "0.6.1", path = "../compat"} +swc_ecma_transforms_module = {version = "0.6.1", path = "../module"} +swc_ecma_transforms_proposal = {version = "0.6.1", path = "../proposal/"} +swc_ecma_transforms_testing = {version = "0.5.1", path = "../testing"} +testing = {version = "0.10.3", path = "../../../testing"} walkdir = "2.3.1" diff --git a/ecmascript/utils/Cargo.toml b/ecmascript/utils/Cargo.toml index d606e3a4421..596aaf54e37 100644 --- a/ecmascript/utils/Cargo.toml +++ b/ecmascript/utils/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_utils" repository = "https://github.com/swc-project/swc.git" -version = "0.29.0" +version = "0.29.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -14,10 +14,10 @@ version = "0.29.0" once_cell = "1" scoped-tls = "1" swc_atoms = {version = "0.2.0", path = "../../atoms"} -swc_common = {version = "0.10.0", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_ecma_visit = {version = "0.25.0", path = "../visit"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_ecma_visit = {version = "0.25.1", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] -testing = {version = "0.10.0", path = "../../testing"} +testing = {version = "0.10.3", path = "../../testing"} diff --git a/ecmascript/utils/src/factory.rs b/ecmascript/utils/src/factory.rs index b522aaf49a0..95b29e664fd 100644 --- a/ecmascript/utils/src/factory.rs +++ b/ecmascript/utils/src/factory.rs @@ -50,7 +50,7 @@ pub trait ExprFactory: Into { Expr::Paren(ParenExpr { expr, span }) } - /// Creates a binrary expr `$self === ` + /// Creates a binary expr `$self === ` #[inline] fn make_eq(self, right: T) -> Expr where @@ -59,7 +59,7 @@ pub trait ExprFactory: Into { self.make_bin(op!("==="), right) } - /// Creates a binrary expr `$self $op $rhs` + /// Creates a binary expr `$self $op $rhs` #[inline] fn make_bin(self, op: BinaryOp, right: T) -> Expr where diff --git a/ecmascript/utils/src/lib.rs b/ecmascript/utils/src/lib.rs index bc44a84b98b..1457705a71d 100644 --- a/ecmascript/utils/src/lib.rs +++ b/ecmascript/utils/src/lib.rs @@ -1356,7 +1356,7 @@ pub fn prop_name_to_expr(p: PropName) -> Expr { PropName::Computed(c) => *c.expr, } } -/// Simillar to `prop_name_to_expr`, but used for value position. +/// Similar to `prop_name_to_expr`, but used for value position. /// /// e.g. value from `{ key: value }` pub fn prop_name_to_expr_value(p: PropName) -> Expr { @@ -1487,7 +1487,7 @@ pub fn prepend_stmts( .unwrap_or(to.len()); let mut buf = Vec::with_capacity(to.len() + stmts.len()); - // TODO: Optimze (maybe unsafe) + // TODO: Optimize (maybe unsafe) buf.extend(to.drain(..idx)); buf.extend(stmts); @@ -1779,7 +1779,7 @@ where | Expr::JSXNamespacedName(..) | Expr::JSXEmpty(..) | Expr::JSXElement(..) - | Expr::JSXFragment(..) => unreachable!("simplyfing jsx"), + | Expr::JSXFragment(..) => unreachable!("simplifying jsx"), Expr::TsTypeAssertion(TsTypeAssertion { expr, .. }) | Expr::TsNonNull(TsNonNullExpr { expr, .. }) diff --git a/ecmascript/visit/Cargo.toml b/ecmascript/visit/Cargo.toml index 815256b0799..02e32fc2dbe 100644 --- a/ecmascript/visit/Cargo.toml +++ b/ecmascript/visit/Cargo.toml @@ -6,11 +6,11 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_visit" repository = "https://github.com/swc-project/swc.git" -version = "0.25.0" +version = "0.25.1" [dependencies] num-bigint = {version = "0.2", features = ["serde"]} swc_atoms = {version = "0.2", path = "../../atoms"} -swc_common = {version = "0.10.0", path = "../../common"} -swc_ecma_ast = {version = "0.39.0", path = "../ast"} -swc_visit = {version = "0.2.1", path = "../../visit"} +swc_common = {version = "0.10.10", path = "../../common"} +swc_ecma_ast = {version = "0.39.1", path = "../ast"} +swc_visit = {version = "0.2.3", path = "../../visit"} diff --git a/macros/ast_node/Cargo.toml b/macros/ast_node/Cargo.toml index 3a896a4af6f..9fb3a043957 100644 --- a/macros/ast_node/Cargo.toml +++ b/macros/ast_node/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "ast_node" repository = "https://github.com/swc-project/swc.git" -version = "0.7.1" +version = "0.7.2" [lib] proc-macro = true @@ -16,7 +16,7 @@ darling = "0.10" pmutil = "0.5.1" proc-macro2 = "1" quote = "1" -swc_macros_common = {version = "0.3", path = "../common"} +swc_macros_common = {version = "0.3.2", path = "../common"} [dependencies.syn] features = ["derive", "fold", "parsing", "printing"] diff --git a/macros/common/Cargo.toml b/macros/common/Cargo.toml index f35b184908b..e74e505b0ff 100644 --- a/macros/common/Cargo.toml +++ b/macros/common/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_macros_common" repository = "https://github.com/swc-project/swc.git" -version = "0.3.1" +version = "0.3.2" [dependencies] pmutil = "0.5.1" diff --git a/macros/common/src/binder.rs b/macros/common/src/binder.rs index dfd17aa6ffd..8942e20ca3b 100644 --- a/macros/common/src/binder.rs +++ b/macros/common/src/binder.rs @@ -1,7 +1,7 @@ //! # Example //! //! `_binded_a`, `_binded_b` and `_binded_0` in below example are -//! `BinededField`. +//! `BindedField`. //! //! ```rust //! struct S { diff --git a/macros/common/src/derive.rs b/macros/common/src/derive.rs index 8beaa500e07..86e1774a0d0 100644 --- a/macros/common/src/derive.rs +++ b/macros/common/src/derive.rs @@ -40,7 +40,7 @@ impl<'a> Derive<'a> { where_clause: input.generics.where_clause.clone(), }; - // Handle generic delcared on type. + // Handle generic declared on type. let ty: Box = { let (_, ty_generics, _) = input.generics.split_for_impl(); let mut t = TokenStream::new(); diff --git a/macros/common/src/lib.rs b/macros/common/src/lib.rs index 085395df165..e6a2a299449 100644 --- a/macros/common/src/lib.rs +++ b/macros/common/src/lib.rs @@ -100,9 +100,9 @@ macro_rules! unimplemented { #[macro_export] macro_rules! unreachable { () => {{ - fail!("internal error: unreacable"); + fail!("internal error: unreachable"); }}; ($($args:tt)+) => {{ - fail!("internal error: unreacable\n{}", format_args!($($args)*)); + fail!("internal error: unreachable\n{}", format_args!($($args)*)); }}; } diff --git a/macros/enum_kind/Cargo.toml b/macros/enum_kind/Cargo.toml index b715791cf4d..752201ecca3 100644 --- a/macros/enum_kind/Cargo.toml +++ b/macros/enum_kind/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "enum_kind" repository = "https://github.com/swc-project/swc.git" -version = "0.2.0" +version = "0.2.1" [lib] proc-macro = true @@ -14,7 +14,7 @@ proc-macro = true [dependencies] pmutil = "0.5.1" proc-macro2 = "1" -swc_macros_common = {version = "0.3", path = "../common"} +swc_macros_common = {version = "0.3.2", path = "../common"} [dependencies.syn] features = ["full", "parsing", "printing", "extra-traits"] diff --git a/macros/enum_kind/src/lib.rs b/macros/enum_kind/src/lib.rs index c74bfeeabf8..2d3658a9e69 100644 --- a/macros/enum_kind/src/lib.rs +++ b/macros/enum_kind/src/lib.rs @@ -9,7 +9,7 @@ mod input; mod parse; mod util; -/// # Atributes on enum +/// # Attributes on enum /// ## functions /// `#[kind(functions(name = "return_type"))]` /// diff --git a/macros/from_variant/Cargo.toml b/macros/from_variant/Cargo.toml index f5c4051351d..e87f5eca8bb 100644 --- a/macros/from_variant/Cargo.toml +++ b/macros/from_variant/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "from_variant" repository = "https://github.com/swc-project/swc.git" -version = "0.1.2" +version = "0.1.3" [lib] proc-macro = true @@ -14,7 +14,7 @@ proc-macro = true [dependencies] pmutil = "0.5.3" proc-macro2 = "1" -swc_macros_common = {version = "0.3", path = "../common"} +swc_macros_common = {version = "0.3.2", path = "../common"} [dependencies.syn] features = ["derive", "fold", "parsing", "printing"] diff --git a/macros/string_enum/Cargo.toml b/macros/string_enum/Cargo.toml index 4ed17f7bf10..f9acfe9b817 100644 --- a/macros/string_enum/Cargo.toml +++ b/macros/string_enum/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "string_enum" repository = "https://github.com/swc-project/swc.git" -version = "0.3.0" +version = "0.3.1" [lib] proc-macro = true @@ -15,7 +15,7 @@ proc-macro = true pmutil = "0.5.1" proc-macro2 = "1" quote = "1" -swc_macros_common = {version = "0.3", path = "../common"} +swc_macros_common = {version = "0.3.2", path = "../common"} [dependencies.syn] features = ["full", "parsing", "printing", "extra-traits"] diff --git a/macros/string_enum/src/lib.rs b/macros/string_enum/src/lib.rs index 36ee2e12333..ae51801db0b 100644 --- a/macros/string_enum/src/lib.rs +++ b/macros/string_enum/src/lib.rs @@ -28,8 +28,8 @@ use syn::{self, *}; ///# Output /// /// - `pub fn as_str(&self) -> &'static str` -/// - `impl serde::Serilaize` -/// - `impl serde::Deserilaize` +/// - `impl serde::Serialize` +/// - `impl serde::Deserialize` /// - `impl FromStr` /// - `impl Debug` /// - `impl Display` diff --git a/spack/src/loaders/swc.rs b/spack/src/loaders/swc.rs index 74ffa58bba1..628978bf9ec 100644 --- a/spack/src/loaders/swc.rs +++ b/spack/src/loaders/swc.rs @@ -179,7 +179,7 @@ impl Load for SwcLoader { let program = if config.is_some() { program? } else { - program.context("tried to parse as ecmaascript as it's exlcuded by .swcrc")? + program.context("tried to parse as ecmascript as it's excluded by .swcrc")? }; log::trace!("JsLoader.load: parsed"); diff --git a/src/config.rs b/src/config.rs index 112e37017c7..be7271dcd26 100644 --- a/src/config.rs +++ b/src/config.rs @@ -134,7 +134,7 @@ fn default_is_module() -> bool { true } -/// Configuration related to source map generaged by swc. +/// Configuration related to source map generated by swc. #[derive(Clone, Serialize, Deserialize, Debug)] #[serde(untagged)] pub enum SourceMapsConfig { diff --git a/testing/Cargo.toml b/testing/Cargo.toml index ebb1d172584..6f71652ad8c 100644 --- a/testing/Cargo.toml +++ b/testing/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "testing" repository = "https://github.com/swc-project/swc.git" -version = "0.10.2" +version = "0.10.3" [dependencies] ansi_term = "0.12.1" @@ -16,5 +16,5 @@ log = "0.4" once_cell = "1" pretty_assertions = "0.6.1" regex = "1" -swc_common = {version = "0.10.0", path = "../common", features = ["tty-emitter"]} +swc_common = {version = "0.10.10", path = "../common", features = ["tty-emitter"]} testing_macros = {version = "0.1", path = "./macros"} diff --git a/visit/Cargo.toml b/visit/Cargo.toml index 7288657addf..79c9dc2c9cb 100644 --- a/visit/Cargo.toml +++ b/visit/Cargo.toml @@ -5,10 +5,10 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_visit" repository = "https://github.com/swc-project/swc.git" -version = "0.2.2" +version = "0.2.3" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] either = "1.5.3" -swc_visit_macros = {version = "0.2.1", path = "./macros"} +swc_visit_macros = {version = "0.2.3", path = "./macros"} diff --git a/visit/macros/Cargo.toml b/visit/macros/Cargo.toml index a8c38ee0e19..373d377db50 100644 --- a/visit/macros/Cargo.toml +++ b/visit/macros/Cargo.toml @@ -5,7 +5,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_visit_macros" repository = "https://github.com/swc-project/swc.git" -version = "0.2.2" +version = "0.2.3" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,5 +17,5 @@ Inflector = "0.11.4" pmutil = "0.5.1" proc-macro2 = "1" quote = "1" -swc_macros_common = {version = "0.3", path = "../../macros/common"} +swc_macros_common = {version = "0.3.2", path = "../../macros/common"} syn = {version = "1", features = ["parsing", "full"]} diff --git a/visit/macros/src/lib.rs b/visit/macros/src/lib.rs index 1fd62582fd6..b4d1c974a0c 100644 --- a/visit/macros/src/lib.rs +++ b/visit/macros/src/lib.rs @@ -910,7 +910,7 @@ fn method_sig(mode: Mode, ty: &Type) -> Signature { match mode { Mode::Fold | Mode::VisitMut => { // We can not provide parent node because it's child node is - // part of the parent ndoe. + // part of the parent node. } Mode::Visit | Mode::VisitAll => { p.push_punct(def_site()); diff --git a/wasm/src/lib.rs b/wasm/src/lib.rs index d5b3e43cd9f..d39cf4b2912 100644 --- a/wasm/src/lib.rs +++ b/wasm/src/lib.rs @@ -102,15 +102,15 @@ fn codemap() -> Arc { fn new_handler(_cm: Arc) -> (Arc, BufferedError) { let e = BufferedError::default(); - let handler = Handler::with_emitter(true, false, Box::new(MyEmiter::default())); + let handler = Handler::with_emitter(true, false, Box::new(MyEmitter::default())); (Arc::new(handler), e) } #[derive(Clone, Default)] -struct MyEmiter(BufferedError); +struct MyEmitter(BufferedError); -impl Emitter for MyEmiter { +impl Emitter for MyEmitter { fn emit(&mut self, db: &DiagnosticBuilder<'_>) { let z = &(self.0).0; for msg in &db.message {