From bf445a75c4ed1df5a4f450e0c665159188655de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 10 Feb 2021 17:25:28 +0900 Subject: [PATCH] fix(swc): Fix bugs (#1372) swc_ecma_ast: - Support import assertions for exports. swc_ecma_parser: - Support import assertions for exports. swc_ecma_transform_typescript: - Strip `declare globals` correctly. (#1383) spack: - Re-enable multi-entry tests. --- Cargo.toml | 18 ++-- bundler/Cargo.toml | 16 ++-- bundler/src/bundler/chunk/circular.rs | 1 + bundler/src/bundler/chunk/computed_key.rs | 1 + bundler/src/bundler/chunk/export.rs | 2 + bundler/src/bundler/chunk/merge.rs | 4 + .../deno-8597/{case3 => .case3}/entry.ts | 0 .../deno-8597/{case3 => .case3}/tfjs.ts | 0 .../tests/deno-exec/deno-8725/case1/entry.ts | 2 +- .../tests/deno-exec/deno-8725/case2/entry.ts | 2 +- .../tests/deno-exec/deno-8725/case4/entry.ts | 2 +- .../tests/deno-exec/deno-8725/case5/deps.ts | 2 +- bundler/tests/deno-exec/issue-8302/entry.ts | 2 +- ecmascript/Cargo.toml | 16 ++-- ecmascript/ast/Cargo.toml | 2 +- ecmascript/ast/src/module_decl.rs | 6 ++ ecmascript/codegen/Cargo.toml | 6 +- ecmascript/dep-graph/Cargo.toml | 8 +- ecmascript/ext-transforms/Cargo.toml | 10 +- ecmascript/jsdoc/Cargo.toml | 6 +- ecmascript/parser/Cargo.toml | 6 +- .../parser/src/parser/stmt/module_item.rs | 32 +++++-- .../custom/issue-196-02/input.ts.json | 3 +- .../typescript/custom/issue-535/input.ts.json | 3 +- .../type-only/export/aliased/input.ts.json | 3 +- .../type-only/export/specific/input.ts.json | 3 +- .../export/namespace-from/input.ts.json | 3 +- .../import-assertions/export/test1/input.ts | 1 + .../export/test1/input.ts.json | 94 +++++++++++++++++++ .../import-assertions/export/test2/input.tsx | 1 + .../export/test2/input.tsx.json | 94 +++++++++++++++++++ .../import-assertions/export/test3/input.ts | 1 + .../export/test3/input.ts.json | 71 ++++++++++++++ .../tests/typescript/issue-896/input.ts.json | 3 +- .../modules/exportAsNamespace1/input.ts.json | 3 +- .../modules/exportAsNamespace2/input.ts.json | 3 +- .../modules/exportAsNamespace3/input.ts.json | 3 +- .../modules/exportAsNamespace4/input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 6 +- .../input.ts.json | 3 +- .../es6/modules/exportBinding/input.ts.json | 15 ++- .../es6/modules/exportStar-amd/input.ts.json | 12 ++- .../tsc/es6/modules/exportStar/input.ts.json | 12 ++- .../exportsAndImports1-amd/input.ts.json | 9 +- .../exportsAndImports1-es6/input.ts.json | 9 +- .../modules/exportsAndImports1/input.ts.json | 9 +- .../exportsAndImports2-amd/input.ts.json | 6 +- .../exportsAndImports2-es6/input.ts.json | 6 +- .../modules/exportsAndImports2/input.ts.json | 6 +- .../exportsAndImports3-amd/input.ts.json | 9 +- .../exportsAndImports3-es6/input.ts.json | 9 +- .../modules/exportsAndImports3/input.ts.json | 9 +- .../exportsAndImports4-amd/input.ts.json | 3 +- .../exportsAndImports4-es6/input.ts.json | 3 +- .../modules/exportsAndImports4/input.ts.json | 3 +- .../input.ts.json | 3 +- .../reExportDefaultExport/input.ts.json | 3 +- .../es6modulekindWithES5Target9/input.ts.json | 15 ++- .../input.ts.json | 15 ++- .../input.ts.json | 3 +- .../exportNonLocalDeclarations/input.ts.json | 6 +- .../input.ts.json | 3 +- .../importsImplicitlyReadonly/input.ts.json | 3 +- .../topLevelAwait.3/input.ts.json | 3 +- .../typeOnly/chained/input.ts.json | 9 +- .../typeOnly/chained2/input.ts.json | 9 +- .../typeOnly/circular1/input.ts.json | 6 +- .../typeOnly/circular3/input.ts.json | 6 +- .../typeOnly/exportDeclaration/input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../exportDeclaration_value/input.ts.json | 6 +- .../typeOnly/exportNamespace1/input.ts.json | 6 +- .../typeOnly/exportNamespace3/input.ts.json | 6 +- .../typeOnly/generic/input.ts.json | 3 +- .../typeOnly/implementsClause/input.ts.json | 3 +- .../typeOnly/importEquals2/input.ts.json | 3 +- .../namespaceImportTypeQuery/input.ts.json | 3 +- .../namespaceMemberAccess/input.ts.json | 3 +- .../typeOnly/renamed/input.ts.json | 6 +- .../jsDeclarationsClassAccessor/input.ts.json | 3 +- .../jsDeclarationsClasses/input.ts.json | 12 ++- .../jsDeclarationsDefault/input.ts.json | 6 +- .../jsDeclarationsDefaultsErr/input.ts.json | 3 +- .../jsDeclarationsEnums/input.ts.json | 12 ++- .../jsDeclarationsExportForms/input.ts.json | 18 ++-- .../input.ts.json | 3 +- .../jsDeclarationsFunctions/input.ts.json | 12 ++- .../input.ts.json | 6 +- .../jsDeclarationsInterfaces/input.ts.json | 12 ++- .../input.ts.json | 24 +++-- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../jsDeclarationsTypeAliases/input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.tsx.json | 3 +- .../input.tsx.json | 3 +- .../input.tsx.json | 6 +- .../input.tsx.json | 3 +- .../input.tsx.json | 6 +- .../input.tsx.json | 3 +- .../input.tsx.json | 3 +- .../input.tsx.json | 3 +- .../input.tsx.json | 3 +- .../input.ts.json | 3 +- .../importTypeAmdBundleRewrite/input.ts.json | 6 +- .../importTypeGenericTypes/input.ts.json | 3 +- .../import/importTypeLocal/input.ts.json | 3 +- .../importTypeLocalMissing/input.ts.json | 3 +- .../input.ts.json | 3 +- ecmascript/preset_env/Cargo.toml | 14 +-- ecmascript/transforms/Cargo.toml | 28 +++--- ecmascript/transforms/base/Cargo.toml | 12 +-- ecmascript/transforms/base/src/hygiene/ops.rs | 2 + ecmascript/transforms/compat/Cargo.toml | 14 +-- .../transforms/compat/src/es2015/classes.rs | 1 + .../compat/src/es2018/object_rest_spread.rs | 1 + .../compat/src/es2020/class_properties.rs | 1 + .../src/es2020/export_namespace_from.rs | 1 + ecmascript/transforms/module/Cargo.toml | 16 ++-- ecmascript/transforms/optimization/Cargo.toml | 24 ++--- ecmascript/transforms/proposal/Cargo.toml | 18 ++-- .../transforms/proposal/src/decorators.rs | 1 + .../proposal/src/decorators/legacy.rs | 1 + .../proposal/src/export_default_from.rs | 1 + ecmascript/transforms/react/Cargo.toml | 18 ++-- ecmascript/transforms/testing/Cargo.toml | 14 +-- ecmascript/transforms/typescript/Cargo.toml | 22 ++--- ecmascript/transforms/typescript/src/strip.rs | 4 + .../transforms/typescript/tests/strip.rs | 13 +++ ecmascript/utils/Cargo.toml | 6 +- ecmascript/visit/Cargo.toml | 4 +- ecmascript/visit/src/lib.rs | 2 + spack/src/config/mod.rs | 1 + spack/src/config/output.rs | 1 + .../multi-entry/.simple/output/entry-a.js | 6 -- .../multi-entry/.simple/output/entry-b.js | 2 - .../{.simple => simple}/input/c.js | 0 .../{.simple => simple}/input/d.js | 0 .../{.simple => simple}/input/entry-a.js | 0 .../{.simple => simple}/input/entry-b.js | 0 .../output/d-2w4j5tksz1e1k.js} | 3 +- .../pass/multi-entry/simple/output/entry-a.js | 13 +++ .../pass/multi-entry/simple/output/entry-b.js | 2 + 145 files changed, 806 insertions(+), 317 deletions(-) rename bundler/tests/deno-exec/deno-8597/{case3 => .case3}/entry.ts (100%) rename bundler/tests/deno-exec/deno-8597/{case3 => .case3}/tfjs.ts (100%) create mode 100644 ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts create mode 100644 ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts.json create mode 100644 ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx create mode 100644 ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx.json create mode 100644 ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts create mode 100644 ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts.json delete mode 100644 spack/tests/pass/multi-entry/.simple/output/entry-a.js delete mode 100644 spack/tests/pass/multi-entry/.simple/output/entry-b.js rename spack/tests/pass/multi-entry/{.simple => simple}/input/c.js (100%) rename spack/tests/pass/multi-entry/{.simple => simple}/input/d.js (100%) rename spack/tests/pass/multi-entry/{.simple => simple}/input/entry-a.js (100%) rename spack/tests/pass/multi-entry/{.simple => simple}/input/entry-b.js (100%) rename spack/tests/pass/multi-entry/{.simple/output/d-175xpbs4ddbvu.js => simple/output/d-2w4j5tksz1e1k.js} (57%) create mode 100644 spack/tests/pass/multi-entry/simple/output/entry-a.js create mode 100644 spack/tests/pass/multi-entry/simple/output/entry-b.js diff --git a/Cargo.toml b/Cargo.toml index 0e900aec24a2..38b671a743df 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.2.7" +version = "0.3.0" [lib] name = "swc" @@ -27,12 +27,12 @@ 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.37.3", path = "./ecmascript/ast"} -swc_ecma_codegen = {version = "0.43.7", path = "./ecmascript/codegen"} -swc_ecma_ext_transforms = {version = "0.2.5", path = "./ecmascript/ext-transforms"} -swc_ecma_parser = {version = "0.45.6", path = "./ecmascript/parser"} -swc_ecma_preset_env = {version = "0.3.7", path = "./ecmascript/preset_env"} -swc_ecma_transforms = {version = "0.33.8", path = "./ecmascript/transforms", features = [ +swc_ecma_ast = {version = "0.38.0", path = "./ecmascript/ast"} +swc_ecma_codegen = {version = "0.44.0", path = "./ecmascript/codegen"} +swc_ecma_ext_transforms = {version = "0.3.0", path = "./ecmascript/ext-transforms"} +swc_ecma_parser = {version = "0.46.0", path = "./ecmascript/parser"} +swc_ecma_preset_env = {version = "0.4.0", path = "./ecmascript/preset_env"} +swc_ecma_transforms = {version = "0.34.0", path = "./ecmascript/transforms", features = [ "compat", "module", "optimization", @@ -40,8 +40,8 @@ swc_ecma_transforms = {version = "0.33.8", path = "./ecmascript/transforms", fea "react", "typescript", ]} -swc_ecma_utils = {version = "0.27.3", path = "./ecmascript/utils"} -swc_ecma_visit = {version = "0.23.3", path = "./ecmascript/visit"} +swc_ecma_utils = {version = "0.28.0", path = "./ecmascript/utils"} +swc_ecma_visit = {version = "0.24.0", path = "./ecmascript/visit"} swc_visit = {version = "0.2", path = "./visit"} [dev-dependencies] diff --git a/bundler/Cargo.toml b/bundler/Cargo.toml index 2327ab5854d4..eeaeca075c9d 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.20.9" +version = "0.21.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] @@ -31,19 +31,19 @@ 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.37.3", path = "../ecmascript/ast"} -swc_ecma_codegen = {version = "0.43.7", path = "../ecmascript/codegen"} -swc_ecma_parser = {version = "0.45.6", path = "../ecmascript/parser"} -swc_ecma_transforms = {version = "0.33.8", path = "../ecmascript/transforms", features = ["optimization"]} -swc_ecma_utils = {version = "0.27.3", path = "../ecmascript/utils"} -swc_ecma_visit = {version = "0.23.3", path = "../ecmascript/visit"} +swc_ecma_ast = {version = "0.38.0", path = "../ecmascript/ast"} +swc_ecma_codegen = {version = "0.44.0", path = "../ecmascript/codegen"} +swc_ecma_parser = {version = "0.46.0", path = "../ecmascript/parser"} +swc_ecma_transforms = {version = "0.34.0", path = "../ecmascript/transforms", features = ["optimization"]} +swc_ecma_utils = {version = "0.28.0", path = "../ecmascript/utils"} +swc_ecma_visit = {version = "0.24.0", 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.33.8", path = "../ecmascript/transforms", features = ["react", "typescript"]} +swc_ecma_transforms = {version = "0.34.0", path = "../ecmascript/transforms", features = ["react", "typescript"]} tempfile = "3.1.0" testing = {version = "0.10.0", path = "../testing"} url = "2.1.1" diff --git a/bundler/src/bundler/chunk/circular.rs b/bundler/src/bundler/chunk/circular.rs index a91efd6f8756..0cf0360192f4 100644 --- a/bundler/src/bundler/chunk/circular.rs +++ b/bundler/src/bundler/chunk/circular.rs @@ -103,6 +103,7 @@ where specifiers: exports, src: None, type_only: false, + asserts: None, }, ))); } diff --git a/bundler/src/bundler/chunk/computed_key.rs b/bundler/src/bundler/chunk/computed_key.rs index ff49c7fad59a..c7524cec6555 100644 --- a/bundler/src/bundler/chunk/computed_key.rs +++ b/bundler/src/bundler/chunk/computed_key.rs @@ -157,6 +157,7 @@ where specifiers: vec![specifier], src: None, type_only: false, + asserts: None, }), )); } diff --git a/bundler/src/bundler/chunk/export.rs b/bundler/src/bundler/chunk/export.rs index fc49ea1be4b6..33e19d636548 100644 --- a/bundler/src/bundler/chunk/export.rs +++ b/bundler/src/bundler/chunk/export.rs @@ -154,6 +154,7 @@ pub(super) fn inject_export( exported: None, })], type_only: false, + asserts: None, })); } else { *item = ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(NamedExport { @@ -161,6 +162,7 @@ pub(super) fn inject_export( specifiers: export.specifiers.take(), src: None, type_only: false, + asserts: None, })) } } diff --git a/bundler/src/bundler/chunk/merge.rs b/bundler/src/bundler/chunk/merge.rs index 8ef7c52e885e..c5c538a6e84c 100644 --- a/bundler/src/bundler/chunk/merge.rs +++ b/bundler/src/bundler/chunk/merge.rs @@ -966,6 +966,7 @@ where specifiers: vec![specifier], src: None, type_only: false, + asserts: None, }, ))); } @@ -1004,6 +1005,7 @@ where specifiers: vec![specifier], src: None, type_only: false, + asserts: None, }, ))); } @@ -1052,6 +1054,7 @@ where .collect(), src: None, type_only: false, + asserts: None, }, ))); continue; @@ -1077,6 +1080,7 @@ where specifiers: vec![specifier], src: None, type_only: false, + asserts: None, }, ))); } diff --git a/bundler/tests/deno-exec/deno-8597/case3/entry.ts b/bundler/tests/deno-exec/deno-8597/.case3/entry.ts similarity index 100% rename from bundler/tests/deno-exec/deno-8597/case3/entry.ts rename to bundler/tests/deno-exec/deno-8597/.case3/entry.ts diff --git a/bundler/tests/deno-exec/deno-8597/case3/tfjs.ts b/bundler/tests/deno-exec/deno-8597/.case3/tfjs.ts similarity index 100% rename from bundler/tests/deno-exec/deno-8597/case3/tfjs.ts rename to bundler/tests/deno-exec/deno-8597/.case3/tfjs.ts diff --git a/bundler/tests/deno-exec/deno-8725/case1/entry.ts b/bundler/tests/deno-exec/deno-8725/case1/entry.ts index b2c7d84f9228..8a096a96d926 100644 --- a/bundler/tests/deno-exec/deno-8725/case1/entry.ts +++ b/bundler/tests/deno-exec/deno-8725/case1/entry.ts @@ -1 +1 @@ -export * from 'https://raw.githubusercontent.com/nats-io/nats.ws/deno-1.6.0/src/mod.ts' \ No newline at end of file +export * from 'https://raw.githubusercontent.com/nats-io/nats.ws/master/src/mod.ts' \ No newline at end of file diff --git a/bundler/tests/deno-exec/deno-8725/case2/entry.ts b/bundler/tests/deno-exec/deno-8725/case2/entry.ts index fc9ce991b002..8319bbdf66df 100644 --- a/bundler/tests/deno-exec/deno-8725/case2/entry.ts +++ b/bundler/tests/deno-exec/deno-8725/case2/entry.ts @@ -1 +1 @@ -export * from "https://raw.githubusercontent.com/nats-io/nats.ws/deno-1.6.0/src/mod.ts"; \ No newline at end of file +export * from "https://raw.githubusercontent.com/nats-io/nats.ws/master/src/mod.ts"; \ No newline at end of file diff --git a/bundler/tests/deno-exec/deno-8725/case4/entry.ts b/bundler/tests/deno-exec/deno-8725/case4/entry.ts index 0c283fecdbd1..23fa7c77e714 100644 --- a/bundler/tests/deno-exec/deno-8725/case4/entry.ts +++ b/bundler/tests/deno-exec/deno-8725/case4/entry.ts @@ -1 +1 @@ -export * from "https://raw.githubusercontent.com/nats-io/nats.ws/deno-1.6.0/src/nats-base-client.ts"; \ No newline at end of file +export * from "https://raw.githubusercontent.com/nats-io/nats.ws/master/src/nats-base-client.ts"; \ No newline at end of file diff --git a/bundler/tests/deno-exec/deno-8725/case5/deps.ts b/bundler/tests/deno-exec/deno-8725/case5/deps.ts index b2c7d84f9228..8a096a96d926 100644 --- a/bundler/tests/deno-exec/deno-8725/case5/deps.ts +++ b/bundler/tests/deno-exec/deno-8725/case5/deps.ts @@ -1 +1 @@ -export * from 'https://raw.githubusercontent.com/nats-io/nats.ws/deno-1.6.0/src/mod.ts' \ No newline at end of file +export * from 'https://raw.githubusercontent.com/nats-io/nats.ws/master/src/mod.ts' \ No newline at end of file diff --git a/bundler/tests/deno-exec/issue-8302/entry.ts b/bundler/tests/deno-exec/issue-8302/entry.ts index f5daf6bbecdb..0ed62abe4160 100644 --- a/bundler/tests/deno-exec/issue-8302/entry.ts +++ b/bundler/tests/deno-exec/issue-8302/entry.ts @@ -1,2 +1,2 @@ -import axiod from 'https://deno.land/x/axiod/mod.ts'; +import axiod from 'https://deno.land/x/axiod@0.20.0-0/mod.ts'; console.log(axiod) \ No newline at end of file diff --git a/ecmascript/Cargo.toml b/ecmascript/Cargo.toml index a30c0239399f..24974b0f25fa 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.18.8" +version = "0.19.0" [features] codegen = ["swc_ecma_codegen"] @@ -24,12 +24,12 @@ react = ["swc_ecma_transforms/react"] typescript = ["swc_ecma_transforms/typescript"] [dependencies] -swc_ecma_ast = {version = "0.37.3", path = "./ast"} -swc_ecma_codegen = {version = "0.43.7", path = "./codegen", optional = true} -swc_ecma_dep_graph = {version = "0.12.5", path = "./dep-graph", optional = true} -swc_ecma_parser = {version = "0.45.6", path = "./parser", optional = true} -swc_ecma_transforms = {version = "0.33.8", path = "./transforms", optional = true} -swc_ecma_utils = {version = "0.27.3", path = "./utils", optional = true} -swc_ecma_visit = {version = "0.23.3", path = "./visit", optional = true} +swc_ecma_ast = {version = "0.38.0", path = "./ast"} +swc_ecma_codegen = {version = "0.44.0", path = "./codegen", optional = true} +swc_ecma_dep_graph = {version = "0.13.0", path = "./dep-graph", optional = true} +swc_ecma_parser = {version = "0.46.0", path = "./parser", optional = true} +swc_ecma_transforms = {version = "0.34.0", path = "./transforms", optional = true} +swc_ecma_utils = {version = "0.28.0", path = "./utils", optional = true} +swc_ecma_visit = {version = "0.24.0", path = "./visit", optional = true} [dev-dependencies] diff --git a/ecmascript/ast/Cargo.toml b/ecmascript/ast/Cargo.toml index 6f84febe6b3d..cdf2d2d1cc2e 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.37.3" +version = "0.38.0" [features] default = [] diff --git a/ecmascript/ast/src/module_decl.rs b/ecmascript/ast/src/module_decl.rs index d42b8860436d..bac17fbf20a7 100644 --- a/ecmascript/ast/src/module_decl.rs +++ b/ecmascript/ast/src/module_decl.rs @@ -90,6 +90,9 @@ pub struct ExportAll { #[serde(rename = "source")] pub src: Str, + + #[serde(default)] + pub asserts: Option, } /// `export { foo } from 'mod'` @@ -107,6 +110,9 @@ pub struct NamedExport { #[serde(rename = "typeOnly")] pub type_only: bool, + + #[serde(default)] + pub asserts: Option, } #[ast_node("ExportDefaultDeclaration")] diff --git a/ecmascript/codegen/Cargo.toml b/ecmascript/codegen/Cargo.toml index f53ea1e1898d..d4e0b53567f5 100644 --- a/ecmascript/codegen/Cargo.toml +++ b/ecmascript/codegen/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0/MIT" name = "swc_ecma_codegen" repository = "https://github.com/swc-project/swc.git" -version = "0.43.8" +version = "0.44.0" [dependencies] bitflags = "1" @@ -15,9 +15,9 @@ 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.37.3", path = "../ast"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} swc_ecma_codegen_macros = {version = "0.5", path = "./macros"} -swc_ecma_parser = {version = "0.45.6", path = "../parser"} +swc_ecma_parser = {version = "0.46.0", path = "../parser"} [dev-dependencies] swc_common = {version = "0.10.0", path = "../../common", features = ["sourcemap"]} diff --git a/ecmascript/dep-graph/Cargo.toml b/ecmascript/dep-graph/Cargo.toml index ea823c4fbf37..d7b17890afc9 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.12.5" +version = "0.13.0" [dependencies] swc_atoms = {version = "0.2", path = "../../atoms"} swc_common = {version = "0.10.1", path = "../../common"} -swc_ecma_ast = {version = "0.37.3", path = "../ast"} -swc_ecma_visit = {version = "0.23.3", path = "../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} +swc_ecma_visit = {version = "0.24.0", path = "../visit"} [dev-dependencies] -swc_ecma_parser = {version = "0.45.6", path = "../parser"} +swc_ecma_parser = {version = "0.46.0", path = "../parser"} testing = {version = "0.10.0", path = "../../testing"} diff --git a/ecmascript/ext-transforms/Cargo.toml b/ecmascript/ext-transforms/Cargo.toml index 90f8a68e2650..02f513881e7e 100644 --- a/ecmascript/ext-transforms/Cargo.toml +++ b/ecmascript/ext-transforms/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://swc.rs/rustdoc/swc_ecma_ext_transforms/" edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_ext_transforms" -version = "0.2.5" +version = "0.3.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -13,7 +13,7 @@ version = "0.2.5" 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.37.3", path = "../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../parser"} -swc_ecma_utils = {version = "0.27.3", path = "../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../parser"} +swc_ecma_utils = {version = "0.28.0", path = "../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../visit"} diff --git a/ecmascript/jsdoc/Cargo.toml b/ecmascript/jsdoc/Cargo.toml index 858094382d68..c0f258831f6f 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.13.5" +version = "0.14.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -18,7 +18,7 @@ swc_common = {version = "0.10.0", path = "../../common"} [dev-dependencies] anyhow = "1" dashmap = "3" -swc_ecma_ast = {version = "0.37.3", path = "../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../parser"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../parser"} testing = {version = "0.10.0", path = "../../testing"} walkdir = "2" diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml index 2b839f3ed18b..ac5316eb020c 100644 --- a/ecmascript/parser/Cargo.toml +++ b/ecmascript/parser/Cargo.toml @@ -7,7 +7,7 @@ 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.45.6" +version = "0.46.0" [features] default = [] @@ -22,8 +22,8 @@ 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.37.3", path = "../ast"} -swc_ecma_visit = {version = "0.23.3", path = "../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} +swc_ecma_visit = {version = "0.24.0", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index 60b3b0d8c5df..ef22ccfc73cf 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -296,10 +296,11 @@ impl<'a, I: Tokens> Parser { if eat!(self, '*') { has_star = true; if is!(self, "from") { - let src = self.parse_from_clause_and_semi()?; + let (src, asserts) = self.parse_from_clause_and_semi()?; return Ok(ModuleDecl::ExportAll(ExportAll { span: span!(self, start), src, + asserts, })); } if eat!(self, "as") { @@ -429,12 +430,13 @@ impl<'a, I: Tokens> Parser { if is!(self, "from") { if let Some(s) = export_ns { - let src = self.parse_from_clause_and_semi()?; + let (src, asserts) = self.parse_from_clause_and_semi()?; return Ok(ModuleDecl::ExportNamed(NamedExport { span: Span::new(start, src.span.hi(), Default::default()), specifiers: vec![s], src: Some(src), type_only, + asserts, })); } } @@ -452,7 +454,7 @@ impl<'a, I: Tokens> Parser { if is!(self, "from") { if let Some(default) = default { - let src = self.parse_from_clause_and_semi()?; + let (src, asserts) = self.parse_from_clause_and_semi()?; return Ok(ModuleDecl::ExportNamed(NamedExport { span: Span::new(start, src.span.hi(), Default::default()), specifiers: vec![ExportSpecifier::Default(ExportDefaultSpecifier { @@ -460,16 +462,18 @@ impl<'a, I: Tokens> Parser { })], src: Some(src), type_only, + asserts, })); } } if has_star && export_ns.is_none() { // improve error message for `export * from foo` - let src = self.parse_from_clause_and_semi()?; + let (src, asserts) = self.parse_from_clause_and_semi()?; return Ok(ModuleDecl::ExportAll(ExportAll { span: Span::new(start, src.span.hi(), Default::default()), src, + asserts, })); } @@ -504,7 +508,7 @@ impl<'a, I: Tokens> Parser { } expect!(self, '}'); - let src = if is!(self, "from") { + let opt = if is!(self, "from") { Some(self.parse_from_clause_and_semi()?) } else { eat!(self, ';'); @@ -517,11 +521,16 @@ impl<'a, I: Tokens> Parser { } None }; + let (src, asserts) = match opt { + Some(v) => (Some(v.0), v.1), + None => (None, None), + }; return Ok(ModuleDecl::ExportNamed(NamedExport { span: span!(self, start), specifiers, src, type_only, + asserts, })); }; @@ -549,7 +558,8 @@ impl<'a, I: Tokens> Parser { }) } - fn parse_from_clause_and_semi(&mut self) -> PResult { + /// Parses `from 'foo.js' assert {};` + fn parse_from_clause_and_semi(&mut self) -> PResult<(Str, Option)> { expect!(self, "from"); let str_start = cur_pos!(self); @@ -567,8 +577,16 @@ impl<'a, I: Tokens> Parser { }, _ => unexpected!(self, "a string literal"), }; + let asserts = if self.input.syntax().import_assertions() && eat!(self, "assert") { + match *self.parse_object::>()? { + Expr::Object(v) => Some(v), + _ => unreachable!(), + } + } else { + None + }; expect!(self, ';'); - Ok(src) + Ok((src, asserts)) } } diff --git a/ecmascript/parser/tests/typescript/custom/issue-196-02/input.ts.json b/ecmascript/parser/tests/typescript/custom/issue-196-02/input.ts.json index 432d127ad8c0..5748488df346 100644 --- a/ecmascript/parser/tests/typescript/custom/issue-196-02/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/issue-196-02/input.ts.json @@ -151,7 +151,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/custom/issue-535/input.ts.json b/ecmascript/parser/tests/typescript/custom/issue-535/input.ts.json index a59ed9dca7f2..01da167ab40b 100644 --- a/ecmascript/parser/tests/typescript/custom/issue-535/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/issue-535/input.ts.json @@ -26,7 +26,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/custom/type-only/export/aliased/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/export/aliased/input.ts.json index bd0adc069546..9b93f2f9ada9 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/export/aliased/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/type-only/export/aliased/input.ts.json @@ -46,7 +46,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/custom/type-only/export/specific/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/export/specific/input.ts.json index 6461b76846f2..ab1946f46568 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/export/specific/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/type-only/export/specific/input.ts.json @@ -36,7 +36,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/export/namespace-from/input.ts.json b/ecmascript/parser/tests/typescript/export/namespace-from/input.ts.json index 8aa2914f8ce4..fbf4f2223452 100644 --- a/ecmascript/parser/tests/typescript/export/namespace-from/input.ts.json +++ b/ecmascript/parser/tests/typescript/export/namespace-from/input.ts.json @@ -48,7 +48,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts b/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts new file mode 100644 index 000000000000..179ea5ab1343 --- /dev/null +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts @@ -0,0 +1 @@ +export { val } from './foo.js' assert { type: "javascript" }; \ No newline at end of file diff --git a/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts.json b/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts.json new file mode 100644 index 000000000000..8e7fca1ca69d --- /dev/null +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts.json @@ -0,0 +1,94 @@ +{ + "type": "Module", + "span": { + "start": 0, + "end": 61, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "span": { + "start": 0, + "end": 61, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 9, + "end": 12, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 9, + "end": 12, + "ctxt": 0 + }, + "value": "val", + "typeAnnotation": null, + "optional": false + }, + "exported": null + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 20, + "end": 30, + "ctxt": 0 + }, + "value": "./foo.js", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": { + "type": "ObjectExpression", + "span": { + "start": 38, + "end": 60, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 40, + "end": 44, + "ctxt": 0 + }, + "value": "type", + "typeAnnotation": null, + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 46, + "end": 58, + "ctxt": 0 + }, + "value": "javascript", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + } + } + ] + } + } + ], + "interpreter": null +} diff --git a/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx b/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx new file mode 100644 index 000000000000..1048385c80bc --- /dev/null +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx @@ -0,0 +1 @@ +export { val } from './foo.js.js' assert { type: "javascript" }; \ No newline at end of file diff --git a/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx.json b/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx.json new file mode 100644 index 000000000000..98d31cd55661 --- /dev/null +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx.json @@ -0,0 +1,94 @@ +{ + "type": "Module", + "span": { + "start": 0, + "end": 64, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "span": { + "start": 0, + "end": 64, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 9, + "end": 12, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 9, + "end": 12, + "ctxt": 0 + }, + "value": "val", + "typeAnnotation": null, + "optional": false + }, + "exported": null + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 20, + "end": 33, + "ctxt": 0 + }, + "value": "./foo.js.js", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": { + "type": "ObjectExpression", + "span": { + "start": 41, + "end": 63, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 43, + "end": 47, + "ctxt": 0 + }, + "value": "type", + "typeAnnotation": null, + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 49, + "end": 61, + "ctxt": 0 + }, + "value": "javascript", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + } + } + ] + } + } + ], + "interpreter": null +} diff --git a/ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts b/ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts new file mode 100644 index 000000000000..71f424c943f1 --- /dev/null +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts @@ -0,0 +1 @@ +export * from './foo.js' assert { type: "javascript" }; diff --git a/ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts.json b/ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts.json new file mode 100644 index 000000000000..2fd8a9649241 --- /dev/null +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test3/input.ts.json @@ -0,0 +1,71 @@ +{ + "type": "Module", + "span": { + "start": 0, + "end": 55, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportAllDeclaration", + "span": { + "start": 0, + "end": 55, + "ctxt": 0 + }, + "source": { + "type": "StringLiteral", + "span": { + "start": 14, + "end": 24, + "ctxt": 0 + }, + "value": "./foo.js", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "asserts": { + "type": "ObjectExpression", + "span": { + "start": 32, + "end": 54, + "ctxt": 0 + }, + "properties": [ + { + "type": "KeyValueProperty", + "key": { + "type": "Identifier", + "span": { + "start": 34, + "end": 38, + "ctxt": 0 + }, + "value": "type", + "typeAnnotation": null, + "optional": false + }, + "value": { + "type": "StringLiteral", + "span": { + "start": 40, + "end": 52, + "ctxt": 0 + }, + "value": "javascript", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + } + } + ] + } + } + ], + "interpreter": null +} diff --git a/ecmascript/parser/tests/typescript/issue-896/input.ts.json b/ecmascript/parser/tests/typescript/issue-896/input.ts.json index 58c999687786..e9322a714aa8 100644 --- a/ecmascript/parser/tests/typescript/issue-896/input.ts.json +++ b/ecmascript/parser/tests/typescript/issue-896/input.ts.json @@ -26,7 +26,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace1/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace1/input.ts.json index a22cd88b5a88..bdabf23a3867 100644 --- a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace1/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace1/input.ts.json @@ -146,7 +146,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExpressionStatement", diff --git a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace2/input.ts.json index 0241e1754230..f9875f5bdea5 100644 --- a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace2/input.ts.json @@ -146,7 +146,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExpressionStatement", diff --git a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace3/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace3/input.ts.json index 850d6ddf03b9..288548be8d14 100644 --- a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace3/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace3/input.ts.json @@ -146,7 +146,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExpressionStatement", diff --git a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace4/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace4/input.ts.json index 9266cd47f668..1f9e77203360 100644 --- a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace4/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace4/input.ts.json @@ -146,7 +146,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_exportAssignment/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_exportAssignment/input.ts.json index db84e6ac00f6..cc1975416c38 100644 --- a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_exportAssignment/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_exportAssignment/input.ts.json @@ -65,7 +65,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_missingEmitHelpers/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_missingEmitHelpers/input.ts.json index 824c89e1c90b..dc21378048a2 100644 --- a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_missingEmitHelpers/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_missingEmitHelpers/input.ts.json @@ -15,7 +15,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -59,7 +60,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_nonExistent/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_nonExistent/input.ts.json index 343fba5e592b..bdd0e06e586c 100644 --- a/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_nonExistent/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es2020/modules/exportAsNamespace_nonExistent/input.ts.json @@ -48,7 +48,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportBinding/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportBinding/input.ts.json index dbe452602974..d6faaf9f4d90 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportBinding/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportBinding/input.ts.json @@ -36,7 +36,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -78,7 +79,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDefaultExpression", @@ -185,7 +187,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ClassDeclaration", @@ -244,7 +247,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -286,7 +290,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDefaultExpression", diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar-amd/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar-amd/input.ts.json index 9f89f2f1be1c..116aac66a944 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar-amd/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar-amd/input.ts.json @@ -377,7 +377,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -399,7 +400,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -421,7 +423,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -443,7 +446,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar/input.ts.json index a6e9c93367d8..712b54782efd 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportStar/input.ts.json @@ -377,7 +377,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -399,7 +400,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -421,7 +423,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -443,7 +446,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-amd/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-amd/input.ts.json index 50e0521c1909..a3626a87b428 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-amd/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-amd/input.ts.json @@ -734,7 +734,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -959,7 +960,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -1397,7 +1399,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-es6/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-es6/input.ts.json index 202e6ebc08a0..50b6232b8406 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-es6/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1-es6/input.ts.json @@ -734,7 +734,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -959,7 +960,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -1397,7 +1399,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1/input.ts.json index 603af2128e69..dd7fae43cf95 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports1/input.ts.json @@ -734,7 +734,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -959,7 +960,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -1397,7 +1399,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-amd/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-amd/input.ts.json index 8916b28a558d..50a8adec735e 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-amd/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-amd/input.ts.json @@ -197,7 +197,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -335,7 +336,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-es6/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-es6/input.ts.json index 38ddcf111bf8..2a8dfef25928 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-es6/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2-es6/input.ts.json @@ -197,7 +197,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -335,7 +336,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2/input.ts.json index 38379bbe6ac9..950a8b888b72 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports2/input.ts.json @@ -197,7 +197,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -335,7 +336,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-amd/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-amd/input.ts.json index 88b0d8742c79..d246ff93e9e4 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-amd/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-amd/input.ts.json @@ -906,7 +906,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -1231,7 +1232,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -1769,7 +1771,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-es6/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-es6/input.ts.json index 6d7623d73acb..54c03b19cc80 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-es6/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3-es6/input.ts.json @@ -906,7 +906,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -1231,7 +1232,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -1769,7 +1771,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3/input.ts.json index 85d16f3b1ade..8c75143b6508 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports3/input.ts.json @@ -906,7 +906,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -1231,7 +1232,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -1769,7 +1771,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-amd/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-amd/input.ts.json index 294c0e9225c5..8c15eb92d6cc 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-amd/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-amd/input.ts.json @@ -1303,7 +1303,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-es6/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-es6/input.ts.json index 2ef509be11fa..c479c081bdfa 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-es6/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4-es6/input.ts.json @@ -1303,7 +1303,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4/input.ts.json index 2ef509be11fa..c479c081bdfa 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImports4/input.ts.json @@ -1303,7 +1303,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithContextualKeywordNames02/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithContextualKeywordNames02/input.ts.json index 7ac012949ba3..5c9e82dc1401 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithContextualKeywordNames02/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithContextualKeywordNames02/input.ts.json @@ -107,7 +107,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/reExportDefaultExport/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/reExportDefaultExport/input.ts.json index ea2a236d27e6..2cc238d13c01 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/reExportDefaultExport/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/reExportDefaultExport/input.ts.json @@ -78,7 +78,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/es6/es6modulekindWithES5Target9/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/es6/es6modulekindWithES5Target9/input.ts.json index 2f368e7b6f45..797602636c81 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/es6/es6modulekindWithES5Target9/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/es6/es6modulekindWithES5Target9/input.ts.json @@ -172,7 +172,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -204,7 +205,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -236,7 +238,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -258,7 +261,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -303,7 +307,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDefaultExpression", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/esnext/esnextmodulekindWithES5Target9/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/esnext/esnextmodulekindWithES5Target9/input.ts.json index 2f368e7b6f45..797602636c81 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/esnext/esnextmodulekindWithES5Target9/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/esnext/esnextmodulekindWithES5Target9/input.ts.json @@ -172,7 +172,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -204,7 +205,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -236,7 +238,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -258,7 +261,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -303,7 +307,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDefaultExpression", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json index 444492797900..451c70a72b4e 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json @@ -296,7 +296,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ] } diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/exportNonLocalDeclarations/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/exportNonLocalDeclarations/input.ts.json index d6736d36a576..cc05f85fda64 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/exportNonLocalDeclarations/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/exportNonLocalDeclarations/input.ts.json @@ -36,7 +36,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -68,7 +69,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/globalAugmentationModuleResolution/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/globalAugmentationModuleResolution/input.ts.json index 68ef84df7827..6b084fd3e53a 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/globalAugmentationModuleResolution/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/globalAugmentationModuleResolution/input.ts.json @@ -15,7 +15,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "TsModuleDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json index 378e5a4fb357..ad96d5747f12 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json @@ -126,7 +126,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/topLevelAwait.3/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/topLevelAwait.3/input.ts.json index f454bb1c6efe..99fe8d27df59 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/topLevelAwait.3/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/topLevelAwait.3/input.ts.json @@ -15,7 +15,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "VariableDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained/input.ts.json index 3aba20214e5f..2ce2c4c76213 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained/input.ts.json @@ -120,7 +120,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ExportDeclaration", @@ -280,7 +281,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -368,7 +370,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained2/input.ts.json index 45fc6a4fb835..e1ed9d1c1b75 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/chained2/input.ts.json @@ -120,7 +120,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", @@ -273,7 +274,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -360,7 +362,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular1/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular1/input.ts.json index 5eb04bea0aa0..3c75727b1377 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular1/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular1/input.ts.json @@ -49,7 +49,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -94,7 +95,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular3/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular3/input.ts.json index 36e0b9d55308..3abba978c550 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular3/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular3/input.ts.json @@ -92,7 +92,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", @@ -180,7 +181,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration/input.ts.json index 4352c6441320..fd0b160e9cc0 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration/input.ts.json @@ -63,7 +63,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier-isolatedModules/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier-isolatedModules/input.ts.json index 061361f204f5..e7c81443c785 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier-isolatedModules/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier-isolatedModules/input.ts.json @@ -87,7 +87,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier/input.ts.json index f0d6569301c9..347e04aa4d5f 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_moduleSpecifier/input.ts.json @@ -84,7 +84,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_value/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_value/input.ts.json index 2e9ea06d5fe9..0d3f3696cdd1 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_value/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportDeclaration_value/input.ts.json @@ -77,7 +77,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ExportDeclaration", @@ -171,7 +172,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace1/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace1/input.ts.json index 513a51fcc778..1288f3aa9de5 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace1/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace1/input.ts.json @@ -84,7 +84,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -106,7 +107,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace3/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace3/input.ts.json index 378f105363d4..23a48b2e7a97 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace3/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/exportNamespace3/input.ts.json @@ -84,7 +84,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -128,7 +129,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/generic/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/generic/input.ts.json index 61a6b0718a5c..c4b8faa02449 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/generic/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/generic/input.ts.json @@ -169,7 +169,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/implementsClause/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/implementsClause/input.ts.json index 538a4f99e902..c82e3021501c 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/implementsClause/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/implementsClause/input.ts.json @@ -120,7 +120,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importEquals2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importEquals2/input.ts.json index f14616d10855..1be0eadf07ba 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importEquals2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importEquals2/input.ts.json @@ -63,7 +63,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceImportTypeQuery/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceImportTypeQuery/input.ts.json index 75edaaa87fa4..ea6fdac27121 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceImportTypeQuery/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceImportTypeQuery/input.ts.json @@ -63,7 +63,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceMemberAccess/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceMemberAccess/input.ts.json index e9e9502e674b..7653b2aa6e68 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceMemberAccess/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/namespaceMemberAccess/input.ts.json @@ -110,7 +110,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/renamed/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/renamed/input.ts.json index 553f8cd85a2f..6644bb5e77b8 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/renamed/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/renamed/input.ts.json @@ -120,7 +120,8 @@ } ], "source": null, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -175,7 +176,8 @@ "containsQuote": true } }, - "typeOnly": true + "typeOnly": true, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClassAccessor/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClassAccessor/input.ts.json index 51caf88725eb..d83d05525a72 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClassAccessor/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClassAccessor/input.ts.json @@ -15,7 +15,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "TsModuleDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClasses/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClasses/input.ts.json index a6610edfc6e3..7b46711fa19d 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClasses/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsClasses/input.ts.json @@ -1502,7 +1502,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ClassDeclaration", @@ -1571,7 +1572,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", @@ -1648,7 +1650,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -1690,7 +1693,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefault/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefault/input.ts.json index 1c5db938e183..4dbb7d0163d4 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefault/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefault/input.ts.json @@ -176,7 +176,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDefaultDeclaration", @@ -357,7 +358,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefaultsErr/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefaultsErr/input.ts.json index 56f82b3994bb..6afc15628f2c 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefaultsErr/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsDefaultsErr/input.ts.json @@ -257,7 +257,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsEnums/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsEnums/input.ts.json index d04c1c2f0e53..e72872c7e65e 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsEnums/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsEnums/input.ts.json @@ -139,7 +139,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "TsEnumDeclaration", @@ -203,7 +204,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", @@ -275,7 +277,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -317,7 +320,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportForms/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportForms/input.ts.json index 6e39a0067171..c7c31f45ac49 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportForms/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportForms/input.ts.json @@ -104,7 +104,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -126,7 +127,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ExportAllDeclaration", @@ -148,7 +150,8 @@ "type": "normal", "containsQuote": true } - } + }, + "asserts": null }, { "type": "ImportDeclaration", @@ -226,7 +229,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -367,7 +371,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -454,7 +459,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "VariableDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportSpecifierNonlocal/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportSpecifierNonlocal/input.ts.json index c5b19e529596..420f1fde5eda 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportSpecifierNonlocal/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsExportSpecifierNonlocal/input.ts.json @@ -149,7 +149,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctions/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctions/input.ts.json index dcf24d795790..e34671e92b31 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctions/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctions/input.ts.json @@ -818,7 +818,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "FunctionDeclaration", @@ -1026,7 +1027,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", @@ -1111,7 +1113,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -1153,7 +1156,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespace/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespace/input.ts.json index 4926ecd8a8f5..7edee1e5244b 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespace/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportAliasExposedWithinNamespace/input.ts.json @@ -77,7 +77,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -397,7 +398,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsInterfaces/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsInterfaces/input.ts.json index 7c991cef8d8e..a1dbc32b45e1 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsInterfaces/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsInterfaces/input.ts.json @@ -1483,7 +1483,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "TsInterfaceDeclaration", @@ -1556,7 +1557,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", @@ -1637,7 +1639,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -1679,7 +1682,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsMultipleExportFromMerge/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsMultipleExportFromMerge/input.ts.json index 69f157f321a0..d16c1e3b2184 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsMultipleExportFromMerge/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsMultipleExportFromMerge/input.ts.json @@ -236,7 +236,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -281,7 +282,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -346,7 +348,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -411,7 +414,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -466,7 +470,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -521,7 +526,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -566,7 +572,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportNamedDeclaration", @@ -621,7 +628,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliases/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliases/input.ts.json index e057c6b93d1f..d565236227af 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliases/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliases/input.ts.json @@ -210,7 +210,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliasesEsModuleInterop/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliasesEsModuleInterop/input.ts.json index 2a1aa9ea8d39..f9182f6dbdf5 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliasesEsModuleInterop/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsReexportAliasesEsModuleInterop/input.ts.json @@ -262,7 +262,8 @@ "containsQuote": true } }, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeAliases/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeAliases/input.ts.json index 0d50cdd65a73..4a2915bf3573 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeAliases/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeAliases/input.ts.json @@ -15,7 +15,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "FunctionDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeReferences4/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeReferences4/input.ts.json index ef5a5ecb98a8..989e03343188 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeReferences4/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsTypeReferences4/input.ts.json @@ -368,7 +368,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ] } diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryOverridesCompilerOptionx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryOverridesCompilerOptionx/input.tsx.json index 85856902bcf5..30a7d6e7e4eb 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryOverridesCompilerOptionx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryOverridesCompilerOptionx/input.tsx.json @@ -246,7 +246,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformChildrenx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformChildrenx/input.tsx.json index 747f26171ebb..e55644ab2d5a 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformChildrenx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformChildrenx/input.tsx.json @@ -108,7 +108,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportPragmax/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportPragmax/input.tsx.json index 6f144ffd9719..1f692d54c6b9 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportPragmax/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportPragmax/input.tsx.json @@ -237,7 +237,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -495,7 +496,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportx/input.tsx.json index d9c6397bbe46..ba78a7411c4d 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformCustomImportx/input.tsx.json @@ -237,7 +237,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportPragmax/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportPragmax/input.tsx.json index 16b5ce906db1..e99f35ce302f 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportPragmax/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportPragmax/input.tsx.json @@ -372,7 +372,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ImportDeclaration", @@ -765,7 +766,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportx/input.tsx.json index 7f6febf91131..3758ba4a4997 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropCustomImportx/input.tsx.json @@ -372,7 +372,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropx/input.tsx.json index c7ccae385620..e5c841fb033e 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformKeyPropx/input.tsx.json @@ -372,7 +372,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesFragmentx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesFragmentx/input.tsx.json index e2250fad2bec..e0c93fe38223 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesFragmentx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesFragmentx/input.tsx.json @@ -203,7 +203,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesx/input.tsx.json index c5ced6d5b828..df68ac12551f 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxs/jsxJsxsCjsTransformSubstitutesNamesx/input.tsx.json @@ -97,7 +97,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/salsa/requireOfESWithPropertyAccess/input.ts.json b/ecmascript/parser/tests/typescript/tsc/salsa/requireOfESWithPropertyAccess/input.ts.json index 6e4b101cd777..60ded88d7dd4 100644 --- a/ecmascript/parser/tests/typescript/tsc/salsa/requireOfESWithPropertyAccess/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/salsa/requireOfESWithPropertyAccess/input.ts.json @@ -309,7 +309,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeAmdBundleRewrite/input.ts.json b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeAmdBundleRewrite/input.ts.json index c289a037640a..617db4baa1c8 100644 --- a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeAmdBundleRewrite/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeAmdBundleRewrite/input.ts.json @@ -232,7 +232,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "VariableDeclaration", @@ -399,7 +400,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeGenericTypes/input.ts.json b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeGenericTypes/input.ts.json index 0dc995afbf60..715650234c4f 100644 --- a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeGenericTypes/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeGenericTypes/input.ts.json @@ -1018,7 +1018,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocal/input.ts.json b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocal/input.ts.json index a7a96db2a64c..e27a7ddba669 100644 --- a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocal/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocal/input.ts.json @@ -681,7 +681,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocalMissing/input.ts.json b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocalMissing/input.ts.json index eb0942a7b0dc..6ad545b57fbd 100644 --- a/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocalMissing/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/types/import/importTypeLocalMissing/input.ts.json @@ -681,7 +681,8 @@ } ], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null }, { "type": "ExportDeclaration", diff --git a/ecmascript/parser/tests/typescript/tsc/types/intersection/intersectionsAndEmptyObjects/input.ts.json b/ecmascript/parser/tests/typescript/tsc/types/intersection/intersectionsAndEmptyObjects/input.ts.json index 56e25397b56c..e1969c94b747 100644 --- a/ecmascript/parser/tests/typescript/tsc/types/intersection/intersectionsAndEmptyObjects/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/types/intersection/intersectionsAndEmptyObjects/input.ts.json @@ -4380,7 +4380,8 @@ }, "specifiers": [], "source": null, - "typeOnly": false + "typeOnly": false, + "asserts": null } ], "interpreter": null diff --git a/ecmascript/preset_env/Cargo.toml b/ecmascript/preset_env/Cargo.toml index df47aa8d264c..4fb8bfab3237 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.3.7" +version = "0.4.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -20,14 +20,14 @@ st-map = "0.1.2" string_enum = {version = "0.3", path = "../../macros/string_enum"} swc_atoms = {version = "0.2", path = "../../atoms"} swc_common = {version = "0.10", path = "../../common"} -swc_ecma_ast = {version = "0.37.3", path = "../ast"} -swc_ecma_transforms = {version = "0.33.8", path = "../transforms", features = ["compat", "proposal"]} -swc_ecma_utils = {version = "0.27.3", path = "../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} +swc_ecma_transforms = {version = "0.34.0", path = "../transforms", features = ["compat", "proposal"]} +swc_ecma_utils = {version = "0.28.0", path = "../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../visit"} walkdir = "2" [dev-dependencies] pretty_assertions = "0.6" -swc_ecma_codegen = {version = "0.43.7", path = "../codegen"} -swc_ecma_parser = {version = "0.45.6", path = "../parser"} +swc_ecma_codegen = {version = "0.44.0", path = "../codegen"} +swc_ecma_parser = {version = "0.46.0", path = "../parser"} testing = {version = "0.10", path = "../../testing"} diff --git a/ecmascript/transforms/Cargo.toml b/ecmascript/transforms/Cargo.toml index 3bd8c89c84b5..294b0b981a77 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.33.8" +version = "0.34.0" [features] compat = ["swc_ecma_transforms_compat"] @@ -19,24 +19,24 @@ 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.37.3", path = "../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../parser"} -swc_ecma_transforms_base = {version = "0.2.8", path = "./base"} -swc_ecma_transforms_compat = {version = "0.3.7", path = "./compat", optional = true} -swc_ecma_transforms_module = {version = "0.3.7", path = "./module", optional = true} -swc_ecma_transforms_optimization = {version = "0.3.8", path = "./optimization", optional = true} -swc_ecma_transforms_proposal = {version = "0.3.7", path = "./proposal", optional = true} -swc_ecma_transforms_react = {version = "0.3.7", path = "./react", optional = true} -swc_ecma_transforms_typescript = {version = "0.3.9", path = "./typescript", optional = true} -swc_ecma_utils = {version = "0.27.3", path = "../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../parser"} +swc_ecma_transforms_base = {version = "0.3.0", path = "./base"} +swc_ecma_transforms_compat = {version = "0.4.0", path = "./compat", optional = true} +swc_ecma_transforms_module = {version = "0.4.0", path = "./module", optional = true} +swc_ecma_transforms_optimization = {version = "0.4.0", path = "./optimization", optional = true} +swc_ecma_transforms_proposal = {version = "0.4.0", path = "./proposal", optional = true} +swc_ecma_transforms_react = {version = "0.4.0", path = "./react", optional = true} +swc_ecma_transforms_typescript = {version = "0.4.0", path = "./typescript", optional = true} +swc_ecma_utils = {version = "0.28.0", path = "../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] pretty_assertions = "0.6" sourcemap = "6" -swc_ecma_codegen = {version = "0.43.7", path = "../codegen"} -swc_ecma_transforms_testing = {version = "0.2.6", path = "./testing"} +swc_ecma_codegen = {version = "0.44.0", path = "../codegen"} +swc_ecma_transforms_testing = {version = "0.3.0", path = "./testing"} tempfile = "3" testing = {version = "0.10.0", path = "../../testing"} walkdir = "2" diff --git a/ecmascript/transforms/base/Cargo.toml b/ecmascript/transforms/base/Cargo.toml index c70456232321..59c124d5c3ee 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.2.9" +version = "0.3.0" [dependencies] fxhash = "0.2.1" @@ -16,11 +16,11 @@ 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.37.3", path = "../../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} [dev-dependencies] -swc_ecma_codegen = {version = "0.43.7", path = "../../codegen"} +swc_ecma_codegen = {version = "0.44.0", path = "../../codegen"} testing = {version = "0.10", path = "../../../testing"} diff --git a/ecmascript/transforms/base/src/hygiene/ops.rs b/ecmascript/transforms/base/src/hygiene/ops.rs index ef741c54bd07..884e8e15f4a0 100644 --- a/ecmascript/transforms/base/src/hygiene/ops.rs +++ b/ecmascript/transforms/base/src/hygiene/ops.rs @@ -33,6 +33,7 @@ impl<'a> VisitMut for Operator<'a> { })], src: None, type_only: false, + asserts: None, }, ))); }; @@ -135,6 +136,7 @@ impl<'a> VisitMut for Operator<'a> { specifiers: renamed, src: None, type_only: false, + asserts: None, }, ))); } diff --git a/ecmascript/transforms/compat/Cargo.toml b/ecmascript/transforms/compat/Cargo.toml index 9599d97d234a..82823ea5e470 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.3.7" +version = "0.4.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -20,13 +20,13 @@ 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.37.3", path = "../../ast"} -swc_ecma_transforms_base = {version = "0.2.8", path = "../base"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_transforms_base = {version = "0.3.0", path = "../base"} swc_ecma_transforms_macros = {version = "0.2.0", path = "../macros"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} [dev-dependencies] -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_transforms_testing = {version = "0.2.6", path = "../testing"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_transforms_testing = {version = "0.3.0", path = "../testing"} testing = {version = "0.10.2", path = "../../../testing"} diff --git a/ecmascript/transforms/compat/src/es2015/classes.rs b/ecmascript/transforms/compat/src/es2015/classes.rs index 3060cea002e1..94cf09f1aef3 100644 --- a/ecmascript/transforms/compat/src/es2015/classes.rs +++ b/ecmascript/transforms/compat/src/es2015/classes.rs @@ -113,6 +113,7 @@ impl Classes { .into()], src: None, type_only: false, + asserts: None, }, )) { Ok(t) => t, diff --git a/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs b/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs index dfb563459b13..82fcabae40fc 100644 --- a/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs +++ b/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs @@ -249,6 +249,7 @@ impl Fold for RestFolder { specifiers, src: None, type_only: false, + asserts: None, }; let mut var_decl = var_decl.fold_with(self); diff --git a/ecmascript/transforms/compat/src/es2020/class_properties.rs b/ecmascript/transforms/compat/src/es2020/class_properties.rs index 3ed95899c02d..c428f833bf58 100644 --- a/ecmascript/transforms/compat/src/es2020/class_properties.rs +++ b/ecmascript/transforms/compat/src/es2020/class_properties.rs @@ -221,6 +221,7 @@ impl ClassProperties { .into()], src: None, type_only: false, + asserts: None, }, )) { Ok(t) => t, diff --git a/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs b/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs index 33e99b3098c3..7a2e9a5299bc 100644 --- a/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs +++ b/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs @@ -61,6 +61,7 @@ impl Fold for ExportNamespaceFrom { )], src: None, type_only: false, + asserts: None, }, ))); } diff --git a/ecmascript/transforms/module/Cargo.toml b/ecmascript/transforms/module/Cargo.toml index acfe98a36733..932199df71d1 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.3.7" +version = "0.4.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -16,13 +16,13 @@ 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.37.3", path = "../../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.2.8", path = "../base"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.3.0", path = "../base"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.3.7", path = "../compat"} -swc_ecma_transforms_testing = {version = "0.2.6", path = "../testing/"} +swc_ecma_transforms_compat = {version = "0.4.0", path = "../compat"} +swc_ecma_transforms_testing = {version = "0.3.0", path = "../testing/"} testing = {version = "0.10", path = "../../../testing/"} diff --git a/ecmascript/transforms/optimization/Cargo.toml b/ecmascript/transforms/optimization/Cargo.toml index dc49545e6d51..72eff00f38af 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.3.8" +version = "0.4.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -19,16 +19,16 @@ 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.37.3", path = "../../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.2.8", path = "../base"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.3.0", path = "../base"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.3.7", path = "../compat"} -swc_ecma_transforms_module = {version = "0.3.7", path = "../module"} -swc_ecma_transforms_proposal = {version = "0.3.7", path = "../proposal"} -swc_ecma_transforms_react = {version = "0.3.7", path = "../react"} -swc_ecma_transforms_testing = {version = "0.2.6", path = "../testing"} -swc_ecma_transforms_typescript = {version = "0.3.9", path = "../typescript"} +swc_ecma_transforms_compat = {version = "0.4.0", path = "../compat"} +swc_ecma_transforms_module = {version = "0.4.0", path = "../module"} +swc_ecma_transforms_proposal = {version = "0.4.0", path = "../proposal"} +swc_ecma_transforms_react = {version = "0.4.0", path = "../react"} +swc_ecma_transforms_testing = {version = "0.3.0", path = "../testing"} +swc_ecma_transforms_typescript = {version = "0.4.0", path = "../typescript"} diff --git a/ecmascript/transforms/proposal/Cargo.toml b/ecmascript/transforms/proposal/Cargo.toml index 1e11fcb0cfca..bd7f6342c8b0 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.3.7" +version = "0.4.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,13 +17,13 @@ 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.37.3", path = "../../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.2.8", path = "../base"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.3.0", path = "../base"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.3.7", path = "../compat"} -swc_ecma_transforms_module = {version = "0.3.7", path = "../module"} -swc_ecma_transforms_testing = {version = "0.2.6", path = "../testing"} +swc_ecma_transforms_compat = {version = "0.4.0", path = "../compat"} +swc_ecma_transforms_module = {version = "0.4.0", path = "../module"} +swc_ecma_transforms_testing = {version = "0.3.0", path = "../testing"} diff --git a/ecmascript/transforms/proposal/src/decorators.rs b/ecmascript/transforms/proposal/src/decorators.rs index 1e91839a4ee9..21e1faca3e91 100644 --- a/ecmascript/transforms/proposal/src/decorators.rs +++ b/ecmascript/transforms/proposal/src/decorators.rs @@ -206,6 +206,7 @@ impl Fold for Decorators { .into()], src: None, type_only: false, + asserts: None, }, ))); }}; diff --git a/ecmascript/transforms/proposal/src/decorators/legacy.rs b/ecmascript/transforms/proposal/src/decorators/legacy.rs index 2ae50fdcd711..74e7afef63b6 100644 --- a/ecmascript/transforms/proposal/src/decorators/legacy.rs +++ b/ecmascript/transforms/proposal/src/decorators/legacy.rs @@ -159,6 +159,7 @@ impl Fold for Legacy { specifiers: replace(&mut self.exports, Default::default()), src: None, type_only: false, + asserts: None, }); m.body.push(decl.into()); diff --git a/ecmascript/transforms/proposal/src/export_default_from.rs b/ecmascript/transforms/proposal/src/export_default_from.rs index 064827ec29ce..38d1de9b8102 100644 --- a/ecmascript/transforms/proposal/src/export_default_from.rs +++ b/ecmascript/transforms/proposal/src/export_default_from.rs @@ -62,6 +62,7 @@ impl Fold for ExportDefaultFrom { )], src: None, type_only: false, + asserts: None, }, ))); } diff --git a/ecmascript/transforms/react/Cargo.toml b/ecmascript/transforms/react/Cargo.toml index 519a7488731a..9f0c32197fb2 100644 --- a/ecmascript/transforms/react/Cargo.toml +++ b/ecmascript/transforms/react/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_react" repository = "https://github.com/swc-project/swc.git" -version = "0.3.7" +version = "0.4.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -16,13 +16,13 @@ regex = "1.4.2" 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.37.3", path = "../../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.2.8", path = "../base"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.3.0", path = "../base"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.3.7", path = "../compat/"} -swc_ecma_transforms_module = {version = "0.3.7", path = "../module"} -swc_ecma_transforms_testing = {version = "0.2.6", path = "../testing/"} +swc_ecma_transforms_compat = {version = "0.4.0", path = "../compat/"} +swc_ecma_transforms_module = {version = "0.4.0", path = "../module"} +swc_ecma_transforms_testing = {version = "0.3.0", path = "../testing/"} diff --git a/ecmascript/transforms/testing/Cargo.toml b/ecmascript/transforms/testing/Cargo.toml index 29c8f3b3a977..62ff6e6bf4ab 100644 --- a/ecmascript/transforms/testing/Cargo.toml +++ b/ecmascript/transforms/testing/Cargo.toml @@ -6,17 +6,17 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_testing" repository = "https://github.com/swc-project/swc.git" -version = "0.2.6" +version = "0.3.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] swc_common = {version = "0.10", path = "../../../common"} -swc_ecma_ast = {version = "0.37.3", path = "../../ast"} -swc_ecma_codegen = {version = "0.43.7", path = "../../codegen"} -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.2.8", path = "../base"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_codegen = {version = "0.44.0", path = "../../codegen"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.3.0", path = "../base"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} tempfile = "3.1.0" testing = {version = "0.10.2", path = "../../../testing"} diff --git a/ecmascript/transforms/typescript/Cargo.toml b/ecmascript/transforms/typescript/Cargo.toml index 05b1c0748ce4..52a7337025de 100644 --- a/ecmascript/transforms/typescript/Cargo.toml +++ b/ecmascript/transforms/typescript/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_typescript" repository = "https://github.com/swc-project/swc.git" -version = "0.3.9" +version = "0.4.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -14,17 +14,17 @@ 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.37.3", path = "../../ast"} -swc_ecma_parser = {version = "0.45.6", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.2.8", path = "../base"} -swc_ecma_utils = {version = "0.27.3", path = "../../utils"} -swc_ecma_visit = {version = "0.23.3", path = "../../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../../ast"} +swc_ecma_parser = {version = "0.46.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.3.0", path = "../base"} +swc_ecma_utils = {version = "0.28.0", path = "../../utils"} +swc_ecma_visit = {version = "0.24.0", path = "../../visit"} [dev-dependencies] -swc_ecma_codegen = {version = "0.43.7", path = "../../codegen"} -swc_ecma_transforms_compat = {version = "0.3.7", path = "../compat"} -swc_ecma_transforms_module = {version = "0.3.7", path = "../module"} -swc_ecma_transforms_proposal = {version = "0.3.7", path = "../proposal/"} -swc_ecma_transforms_testing = {version = "0.2.6", path = "../testing"} +swc_ecma_codegen = {version = "0.44.0", path = "../../codegen"} +swc_ecma_transforms_compat = {version = "0.4.0", path = "../compat"} +swc_ecma_transforms_module = {version = "0.4.0", path = "../module"} +swc_ecma_transforms_proposal = {version = "0.4.0", path = "../proposal/"} +swc_ecma_transforms_testing = {version = "0.3.0", path = "../testing"} testing = {version = "0.10.2", path = "../../../testing"} walkdir = "2.3.1" diff --git a/ecmascript/transforms/typescript/src/strip.rs b/ecmascript/transforms/typescript/src/strip.rs index 5364cf337920..2c293e198d10 100644 --- a/ecmascript/transforms/typescript/src/strip.rs +++ b/ecmascript/transforms/typescript/src/strip.rs @@ -505,6 +505,10 @@ impl Strip { /// Returns `(var_decl, init)`. fn handle_ts_module(&mut self, module: TsModuleDecl) -> Option<(Decl, Stmt)> { + if module.global { + return None; + } + let module_name = match module.id { TsModuleName::Ident(i) => i, TsModuleName::Str(_) => return None, diff --git a/ecmascript/transforms/typescript/tests/strip.rs b/ecmascript/transforms/typescript/tests/strip.rs index 39401a0612f9..ebce9a1b31e1 100644 --- a/ecmascript/transforms/typescript/tests/strip.rs +++ b/ecmascript/transforms/typescript/tests/strip.rs @@ -3475,3 +3475,16 @@ to!( " " ); + +to!( + issue_1383, + " + declare global { + const process: Process; + } + + export {} + ", + " + " +); diff --git a/ecmascript/utils/Cargo.toml b/ecmascript/utils/Cargo.toml index 1c311d574fba..8dbae9c6e2ae 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.27.3" +version = "0.28.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,8 +15,8 @@ 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.37.3", path = "../ast"} -swc_ecma_visit = {version = "0.23.3", path = "../visit"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} +swc_ecma_visit = {version = "0.24.0", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] diff --git a/ecmascript/visit/Cargo.toml b/ecmascript/visit/Cargo.toml index c83e4e194546..5edaac26bdc9 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.23.3" +version = "0.24.0" [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.37.3", path = "../ast"} +swc_ecma_ast = {version = "0.38.0", path = "../ast"} swc_visit = {version = "0.2.1", path = "../../visit"} diff --git a/ecmascript/visit/src/lib.rs b/ecmascript/visit/src/lib.rs index 6b961668905e..a05e11d974a5 100644 --- a/ecmascript/visit/src/lib.rs +++ b/ecmascript/visit/src/lib.rs @@ -932,12 +932,14 @@ define!({ pub struct ExportAll { pub span: Span, pub src: Str, + pub asserts: Option, } pub struct NamedExport { pub span: Span, pub specifiers: Vec, pub src: Option, pub type_only: bool, + pub asserts: Option, } pub struct ExportDefaultDecl { pub span: Span, diff --git a/spack/src/config/mod.rs b/spack/src/config/mod.rs index b123b780771b..8e7cff1fd8f3 100644 --- a/spack/src/config/mod.rs +++ b/spack/src/config/mod.rs @@ -16,6 +16,7 @@ mod output; mod resolve; #[derive(Debug, Deserialize)] +#[serde(rename_all = "camelCase")] pub struct Config { #[serde(default)] pub working_dir: PathBuf, diff --git a/spack/src/config/output.rs b/spack/src/config/output.rs index 9252d0c1bf0b..1335c3bed492 100644 --- a/spack/src/config/output.rs +++ b/spack/src/config/output.rs @@ -3,6 +3,7 @@ use std::path::PathBuf; #[derive(Debug, Deserialize)] #[serde(rename = "Output")] +#[serde(rename_all = "camelCase")] pub struct OutputConfig { pub path: PathBuf, diff --git a/spack/tests/pass/multi-entry/.simple/output/entry-a.js b/spack/tests/pass/multi-entry/.simple/output/entry-a.js deleted file mode 100644 index a48661bf0097..000000000000 --- a/spack/tests/pass/multi-entry/.simple/output/entry-a.js +++ /dev/null @@ -1,6 +0,0 @@ -import { foo } from './d-175xpbs4ddbvu.js'; -console.log('loading c.js'); -function c() { - foo(); -} -c(); diff --git a/spack/tests/pass/multi-entry/.simple/output/entry-b.js b/spack/tests/pass/multi-entry/.simple/output/entry-b.js deleted file mode 100644 index 5712c892c374..000000000000 --- a/spack/tests/pass/multi-entry/.simple/output/entry-b.js +++ /dev/null @@ -1,2 +0,0 @@ -import { foo } from './d-175xpbs4ddbvu.js'; -foo(); diff --git a/spack/tests/pass/multi-entry/.simple/input/c.js b/spack/tests/pass/multi-entry/simple/input/c.js similarity index 100% rename from spack/tests/pass/multi-entry/.simple/input/c.js rename to spack/tests/pass/multi-entry/simple/input/c.js diff --git a/spack/tests/pass/multi-entry/.simple/input/d.js b/spack/tests/pass/multi-entry/simple/input/d.js similarity index 100% rename from spack/tests/pass/multi-entry/.simple/input/d.js rename to spack/tests/pass/multi-entry/simple/input/d.js diff --git a/spack/tests/pass/multi-entry/.simple/input/entry-a.js b/spack/tests/pass/multi-entry/simple/input/entry-a.js similarity index 100% rename from spack/tests/pass/multi-entry/.simple/input/entry-a.js rename to spack/tests/pass/multi-entry/simple/input/entry-a.js diff --git a/spack/tests/pass/multi-entry/.simple/input/entry-b.js b/spack/tests/pass/multi-entry/simple/input/entry-b.js similarity index 100% rename from spack/tests/pass/multi-entry/.simple/input/entry-b.js rename to spack/tests/pass/multi-entry/simple/input/entry-b.js diff --git a/spack/tests/pass/multi-entry/.simple/output/d-175xpbs4ddbvu.js b/spack/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js similarity index 57% rename from spack/tests/pass/multi-entry/.simple/output/d-175xpbs4ddbvu.js rename to spack/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js index f38e9d0c7e0e..90530a2e6419 100644 --- a/spack/tests/pass/multi-entry/.simple/output/d-175xpbs4ddbvu.js +++ b/spack/tests/pass/multi-entry/simple/output/d-2w4j5tksz1e1k.js @@ -1,4 +1,5 @@ console.log('loading d.js'); -export function foo() { +function foo1() { console.log('d.js'); } +export { foo1 as foo }; diff --git a/spack/tests/pass/multi-entry/simple/output/entry-a.js b/spack/tests/pass/multi-entry/simple/output/entry-a.js new file mode 100644 index 000000000000..c915dcf9368e --- /dev/null +++ b/spack/tests/pass/multi-entry/simple/output/entry-a.js @@ -0,0 +1,13 @@ +console.log('loading d.js'); +function foo() { + console.log('d.js'); +} +const foo1 = foo; +const foo2 = foo1; +console.log('loading c.js'); +function c() { + foo2(); +} +const c1 = c; +const c2 = c1; +c2(); diff --git a/spack/tests/pass/multi-entry/simple/output/entry-b.js b/spack/tests/pass/multi-entry/simple/output/entry-b.js new file mode 100644 index 000000000000..70f8b2c65bcf --- /dev/null +++ b/spack/tests/pass/multi-entry/simple/output/entry-b.js @@ -0,0 +1,2 @@ +const foo1 = foo; +foo1();