mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 05:32:09 +03:00
Fix a number of typos (#1412)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
This commit is contained in:
parent
eecdca4e86
commit
db85d123b7
1
.gitignore
vendored
1
.gitignore
vendored
@ -45,4 +45,3 @@ pkg/
|
||||
|
||||
yarn.lock
|
||||
.idea/
|
||||
|
||||
|
24
Cargo.toml
24
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]]
|
||||
|
@ -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"
|
||||
|
@ -33,7 +33,7 @@ pub struct Config {
|
||||
/// List of modules which should be preserved.
|
||||
pub external_modules: Vec<JsWord>,
|
||||
|
||||
/// Type of emiited module
|
||||
/// Type of emitted module
|
||||
pub module: ModuleType,
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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<HashSet<DiagnosticId>>,
|
||||
|
||||
/// Used to suggest rustc --explain <error code>
|
||||
|
@ -10,7 +10,7 @@
|
||||
//!
|
||||
//! ## `sourcemap`
|
||||
//!
|
||||
//! Adds methods to generator web sourcemap.
|
||||
//! Adds methods to generate web sourcemap.
|
||||
#![deny(unused)]
|
||||
|
||||
pub use self::eq::EqIgnoreSpan;
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
//!
|
||||
|
@ -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<BytePos> 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. `<anon>`
|
||||
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<FileName>,
|
||||
/// 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<String>,
|
||||
/// 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<BytePos>,
|
||||
@ -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<usize> {
|
||||
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)]
|
||||
|
@ -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]
|
||||
|
@ -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"
|
||||
|
@ -96,7 +96,7 @@ pub struct VarDeclarator {
|
||||
#[serde(rename = "id")]
|
||||
pub name: Pat,
|
||||
|
||||
/// Initialization expresion.
|
||||
/// Initialization expression.
|
||||
#[serde(default)]
|
||||
pub init: Option<Box<Expr>>,
|
||||
|
||||
|
@ -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<TsTypeParamInstantiation>,
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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<Expr>),
|
||||
}
|
||||
|
@ -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"}
|
||||
|
@ -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"]
|
||||
|
@ -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,
|
||||
|
@ -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"}
|
||||
|
@ -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"}
|
||||
|
@ -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"
|
||||
|
@ -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]]
|
||||
|
@ -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 {
|
||||
|
@ -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()
|
||||
}
|
||||
|
@ -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<Option<Char>> {
|
||||
@ -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<Char> {
|
||||
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,
|
||||
_ => {}
|
||||
}
|
||||
|
@ -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)]
|
||||
|
@ -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;\
|
||||
|
@ -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
|
||||
//! }
|
||||
|
@ -31,7 +31,7 @@ impl<'a, I: Tokens> Parser<I> {
|
||||
Ok(expr)
|
||||
}
|
||||
|
||||
///`parseMaybeAssign` (overrided)
|
||||
///`parseMaybeAssign` (overridden)
|
||||
pub(super) fn parse_assignment_expr(&mut self) -> PResult<Box<Expr>> {
|
||||
trace_cur!(self, parse_assignment_expr);
|
||||
|
||||
@ -520,7 +520,7 @@ impl<'a, I: Tokens> Parser<I> {
|
||||
self.parse_subscripts(ExprOrSuper::Expr(obj), true)
|
||||
}
|
||||
|
||||
/// Parse `NewExpresion`.
|
||||
/// Parse `NewExpression`.
|
||||
/// This includes `MemberExpression`.
|
||||
pub(super) fn parse_new_expr(&mut self) -> PResult<Box<Expr>> {
|
||||
trace_cur!(self, parse_new_expr);
|
||||
|
@ -30,7 +30,7 @@ pub trait Tokens: Clone + Iterator<Item = TokenAndSpan> {
|
||||
|
||||
/// 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
|
||||
|
@ -119,7 +119,7 @@ impl<I: Tokens> Parser<I> {
|
||||
})
|
||||
}
|
||||
|
||||
/// 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
|
||||
|
@ -414,7 +414,7 @@ impl<I: Tokens> ParseObject<Pat> for Parser<I> {
|
||||
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()?);
|
||||
|
@ -436,7 +436,7 @@ impl<'a, I: Tokens> Parser<I> {
|
||||
pub enum PatType {
|
||||
BindingPat,
|
||||
BindingElement,
|
||||
/// AssigmentPattern
|
||||
/// AssignmentPattern
|
||||
AssignPat,
|
||||
AssignElement,
|
||||
}
|
||||
@ -540,7 +540,7 @@ impl<'a, I: Tokens> Parser<I> {
|
||||
}
|
||||
}
|
||||
|
||||
// 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<I> {
|
||||
// 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);
|
||||
|
@ -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,
|
||||
},
|
||||
|
@ -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}")
|
||||
|
@ -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
|
||||
|
@ -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{}"
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: Invalid unciode escape
|
||||
error: Invalid unicode escape
|
||||
--> $DIR/tests/test262-parser/fail/27e55098f070e9ef.js:1:2
|
||||
|
|
||||
1 | "\u{FFFF"
|
||||
|
@ -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
|
||||
|
@ -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 + ()
|
||||
|
@ -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(){}
|
||||
|
@ -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(){}
|
||||
|
@ -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 {}
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: Invalid unciode escape
|
||||
error: Invalid unicode escape
|
||||
--> $DIR/tests/test262-parser/fail/abe5f49acb8e132a.js:1:2
|
||||
|
|
||||
1 | "\u{FFZ}"
|
||||
|
@ -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}")
|
||||
|
@ -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(){}
|
||||
|
@ -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(){}
|
||||
|
@ -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(){}
|
||||
|
@ -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(){}
|
||||
|
@ -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}"
|
||||
|
@ -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"}
|
||||
|
@ -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"
|
||||
|
@ -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"}
|
||||
|
@ -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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![deny(unused)]
|
||||
|
||||
#[doc(hideen)]
|
||||
#[doc(hidden)]
|
||||
pub mod ext;
|
||||
pub mod fixer;
|
||||
#[macro_use]
|
||||
|
@ -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};
|
||||
|
@ -35,7 +35,7 @@ pub fn resolver() -> impl 'static + Fold {
|
||||
///
|
||||
/// `top_level_mark` should not be root.
|
||||
///
|
||||
/// # Exmaple
|
||||
/// # Example
|
||||
///
|
||||
/// ```js
|
||||
/// let a = 1;
|
||||
|
@ -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 = {};
|
||||
|
||||
|
@ -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<TestDescAndFn>) -> 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()));
|
||||
}
|
||||
|
||||
|
@ -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"}
|
||||
|
@ -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<Box<Expr>>) -> Expr {
|
||||
fn make_reassignment(&self, orig: Option<Box<Expr>>) -> 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)))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -241,7 +241,7 @@ impl Classes {
|
||||
}
|
||||
}
|
||||
|
||||
/// Turns class expresion into iife.
|
||||
/// Turns class expression into iife.
|
||||
///
|
||||
/// ```js
|
||||
/// class Foo {}
|
||||
|
@ -11,7 +11,7 @@ use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Node, Visit, VisitWith};
|
||||
|
||||
pub(super) struct SuperCallFinder {
|
||||
mode: Option<SuperFoldingMode>,
|
||||
/// 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) {
|
||||
|
@ -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<DestructuringVisitor> + FoldWith<AssignFolder>,
|
||||
{
|
||||
// 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<N>(node: &N) -> bool
|
||||
fn has_destructuring<N>(node: &N) -> bool
|
||||
where
|
||||
N: VisitWith<DestructuringVisitor>,
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ struct Regenerator {
|
||||
global_mark: Mark,
|
||||
/// [Some] if used.
|
||||
regenerator_runtime: Option<Ident>,
|
||||
/// Variables delcared in outer function.
|
||||
/// Variables declared in outer function.
|
||||
outer_fn_vars: Vec<VarDeclarator>,
|
||||
/// mark
|
||||
top_level_vars: Vec<VarDeclarator>,
|
||||
|
@ -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,
|
||||
});
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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"]}
|
||||
|
@ -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/"}
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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<Ident> {
|
||||
let entry = self
|
||||
.imports
|
||||
|
@ -2467,7 +2467,7 @@ function diff() {
|
||||
|
||||
// interop_module_shadow
|
||||
test!(
|
||||
// TODO(kdy1): Uningnore this
|
||||
// TODO(kdy1): Unignore this
|
||||
ignore,
|
||||
syntax(),
|
||||
|_| tr(Config {
|
||||
|
@ -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"}
|
||||
|
@ -57,7 +57,7 @@ fn parse_option(cm: &SourceMap, name: &str, src: String) -> Arc<Expr> {
|
||||
.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,
|
||||
)
|
||||
});
|
||||
|
@ -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
|
||||
|
@ -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()})");
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
|
@ -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; };",
|
||||
|
@ -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"}
|
||||
|
@ -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()))),
|
||||
|
@ -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"}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ fn parse_classic_option(cm: &SourceMap, name: &str, src: String) -> Box<Expr> {
|
||||
.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")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -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"}
|
||||
|
@ -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"
|
||||
|
@ -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"}
|
||||
|
@ -50,7 +50,7 @@ pub trait ExprFactory: Into<Expr> {
|
||||
Expr::Paren(ParenExpr { expr, span })
|
||||
}
|
||||
|
||||
/// Creates a binrary expr `$self === `
|
||||
/// Creates a binary expr `$self === `
|
||||
#[inline]
|
||||
fn make_eq<T>(self, right: T) -> Expr
|
||||
where
|
||||
@ -59,7 +59,7 @@ pub trait ExprFactory: Into<Expr> {
|
||||
self.make_bin(op!("==="), right)
|
||||
}
|
||||
|
||||
/// Creates a binrary expr `$self $op $rhs`
|
||||
/// Creates a binary expr `$self $op $rhs`
|
||||
#[inline]
|
||||
fn make_bin<T>(self, op: BinaryOp, right: T) -> Expr
|
||||
where
|
||||
|
@ -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<T: StmtLike>(
|
||||
.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, .. })
|
||||
|
@ -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"}
|
||||
|
@ -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"]
|
||||
|
@ -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"
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! # Example
|
||||
//!
|
||||
//! `_binded_a`, `_binded_b` and `_binded_0` in below example are
|
||||
//! `BinededField`.
|
||||
//! `BindedField`.
|
||||
//!
|
||||
//! ```rust
|
||||
//! struct S {
|
||||
|
@ -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<Type> = {
|
||||
let (_, ty_generics, _) = input.generics.split_for_impl();
|
||||
let mut t = TokenStream::new();
|
||||
|
@ -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)*));
|
||||
}};
|
||||
}
|
||||
|
@ -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"]
|
||||
|
@ -9,7 +9,7 @@ mod input;
|
||||
mod parse;
|
||||
mod util;
|
||||
|
||||
/// # Atributes on enum
|
||||
/// # Attributes on enum
|
||||
/// ## functions
|
||||
/// `#[kind(functions(name = "return_type"))]`
|
||||
///
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user