From 4129a2d7bacb681969ad60944c297b815fff5de9 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 25 Sep 2021 17:10:00 +0800 Subject: [PATCH 01/17] feat(es/parser): support type-only import specifiers --- bundler/src/bundler/import/mod.rs | 2 + ecmascript/ast/src/module_decl.rs | 2 + .../parser/src/parser/stmt/module_item.rs | 65 ++- .../type-only/import/aliased/input.ts.json | 3 +- .../type-only/import/specific/input.ts.json | 3 +- .../import/type-only-specifier/input.ts | 9 + .../import/type-only-specifier/input.ts.json | 479 ++++++++++++++++++ .../tests/typescript/issue-913/input.ts.json | 6 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../asyncImportedPromise_es5/input.ts.json | 3 +- .../input.ts.json | 3 +- .../asyncImportedPromise_es6/input.ts.json | 3 +- .../privateNamesUnique-2/input.ts.json | 6 +- .../exportSpellingSuggestion/input.ts.json | 3 +- .../es6/modules/exportStar-amd/input.ts.json | 12 +- .../tsc/es6/modules/exportStar/input.ts.json | 12 +- .../exportsAndImports1-amd/input.ts.json | 30 +- .../exportsAndImports1-es6/input.ts.json | 30 +- .../modules/exportsAndImports1/input.ts.json | 30 +- .../exportsAndImports2-amd/input.ts.json | 6 +- .../exportsAndImports2-es6/input.ts.json | 6 +- .../modules/exportsAndImports2/input.ts.json | 6 +- .../exportsAndImports3-amd/input.ts.json | 30 +- .../exportsAndImports3-es6/input.ts.json | 30 +- .../modules/exportsAndImports3/input.ts.json | 30 +- .../exportsAndImports4-amd/input.ts.json | 12 +- .../exportsAndImports4-es6/input.ts.json | 12 +- .../modules/exportsAndImports4/input.ts.json | 12 +- .../input.ts.json | 6 +- .../input.ts.json | 18 +- .../reExportDefaultExport/input.ts.json | 3 +- .../asOperator/asOperator4/input.ts.json | 3 +- .../es6modulekindWithES5Target9/input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../importsImplicitlyReadonly/input.ts.json | 6 +- .../typeOnly/ambient/input.ts.json | 3 +- .../typeOnly/chained/input.ts.json | 9 +- .../typeOnly/chained2/input.ts.json | 3 +- .../typeOnly/circular2/input.ts.json | 6 +- .../typeOnly/circular3/input.ts.json | 6 +- .../typeOnly/circular4/input.ts.json | 6 +- .../typeOnly/exportDeclaration/input.ts.json | 3 +- .../input.ts.json | 3 +- .../typeOnly/exportNamespace1/input.ts.json | 3 +- .../typeOnly/exportNamespace3/input.ts.json | 3 +- .../typeOnly/generic/input.ts.json | 6 +- .../importClause_namedImports/input.ts.json | 9 +- .../input.ts.json | 24 +- .../typeOnly/renamed/input.ts.json | 3 +- .../typeOnly/typeQuery/input.ts.json | 3 +- .../jsDeclarationsClassAccessor/input.ts.json | 3 +- .../jsDeclarationsExportForms/input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../tsc/jsdoc/enumTagImported/input.ts.json | 3 +- .../tsc/jsdoc/extendsTagEmit/input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.tsx.json | 21 +- .../inlineJsxAndJsxFragPragmax/input.tsx.json | 9 +- .../input.tsx.json | 15 +- .../input.tsx.json | 6 +- .../input.tsx.json | 6 +- .../input.tsx.json | 3 +- .../input.tsx.json | 6 +- .../tsxElementResolution19x/input.tsx.json | 3 +- .../tsxExternalModuleEmit1x/input.tsx.json | 3 +- .../tsc/jsx/tsxPreserveEmit3x/input.tsx.json | 3 +- .../tsc/jsx/tsxReactEmit5x/input.tsx.json | 3 +- .../scopedPackagesClassic/input.ts.json | 3 +- .../salsa/assignmentToVoidZero2/input.ts.json | 6 +- .../input.ts.json | 3 +- .../tsc/salsa/expandoOnAlias/input.ts.json | 6 +- .../input.ts.json | 3 +- .../typings/typingsLookupAmd/input.ts.json | 6 +- ecmascript/transforms/react/src/jsx/mod.rs | 4 + ecmascript/visit/src/lib.rs | 1 + 82 files changed, 939 insertions(+), 190 deletions(-) create mode 100644 ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts create mode 100644 ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json diff --git a/bundler/src/bundler/import/mod.rs b/bundler/src/bundler/import/mod.rs index e61a2cbcb859..e50cfdd22a00 100644 --- a/bundler/src/bundler/import/mod.rs +++ b/bundler/src/bundler/import/mod.rs @@ -475,6 +475,7 @@ where span: DUMMY_SP, local: Ident::new(id.0, DUMMY_SP.with_ctxt(id.1)), imported: None, + is_type_only: false, }) }) .collect(); @@ -634,6 +635,7 @@ where span, local: ident, imported: None, + is_type_only: false, }) }) .collect(), diff --git a/ecmascript/ast/src/module_decl.rs b/ecmascript/ast/src/module_decl.rs index 9d67959fb3f9..027d8dd52441 100644 --- a/ecmascript/ast/src/module_decl.rs +++ b/ecmascript/ast/src/module_decl.rs @@ -199,6 +199,8 @@ pub struct ImportNamedSpecifier { #[serde(default)] pub imported: Option, + + pub is_type_only: bool, } #[ast_node] diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index 79248adec9b3..ba2f1f5c4182 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -181,7 +181,68 @@ impl<'a, I: Tokens> Parser { let start = cur_pos!(self); match cur!(self, false) { Ok(&Word(..)) => { - let orig_name = self.parse_ident_name()?; + let mut is_type_only = false; + let mut orig_name = self.parse_ident_name()?; + + // Handle: + // `import { type xx } from 'mod'` + // `import { type xx as yy } from 'mod'` + // `import { type as } from 'mod'` + // `import { type as as } from 'mod'` + // `import { type as as as } from 'mod'` + if orig_name.sym == js_word!("type") + && is!(self, IdentName) + && self.syntax().typescript() + { + let possibly_orgi_name = self.parse_ident_name()?; + if possibly_orgi_name.sym == js_word!("as") { + // `import { type as } from 'mod'` + if !is!(self, IdentName) { + return Ok(ImportSpecifier::Named(ImportNamedSpecifier { + span: span!(self, start), + local: possibly_orgi_name, + imported: None, + is_type_only: true, + })); + } + + let maybe_as = self.parse_binding_ident()?.id; + if maybe_as.sym == js_word!("as") { + if is!(self, IdentName) { + // `import { type as as as } from 'mod'` + // `import { type as as foo } from 'mod'` + let local = self.parse_binding_ident()?.id; + return Ok(ImportSpecifier::Named(ImportNamedSpecifier { + span: Span::new(start, orig_name.span.hi(), Default::default()), + local, + imported: Some(possibly_orgi_name), + is_type_only: true, + })); + } else { + // `import { type as as } from 'mod'` + return Ok(ImportSpecifier::Named(ImportNamedSpecifier { + span: Span::new(start, maybe_as.span.hi(), Default::default()), + local: maybe_as, + imported: Some(orig_name), + is_type_only: false, + })); + } + } else { + // `import { type as xxx } from 'mod'` + return Ok(ImportSpecifier::Named(ImportNamedSpecifier { + span: Span::new(start, orig_name.span.hi(), Default::default()), + local: maybe_as, + imported: Some(orig_name), + is_type_only: false, + })); + } + } else { + // `import { type xx } from 'mod'` + // `import { type xx as yy } from 'mod'` + orig_name = possibly_orgi_name; + is_type_only = true; + } + } if eat!(self, "as") { let local = self.parse_binding_ident()?.id; @@ -189,6 +250,7 @@ impl<'a, I: Tokens> Parser { span: Span::new(start, local.span.hi(), Default::default()), local, imported: Some(orig_name), + is_type_only, })); } @@ -205,6 +267,7 @@ impl<'a, I: Tokens> Parser { span: span!(self, start), local, imported: None, + is_type_only, })) } _ => unexpected!(self, "an identifier"), diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/aliased/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/import/aliased/input.ts.json index fd6e8040a5d8..10643a4d6577 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/import/aliased/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/aliased/input.ts.json @@ -40,7 +40,8 @@ }, "value": "Foo", "optional": false - } + }, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/specific/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/import/specific/input.ts.json index 63c4c4681c89..c9bdf502c95d 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/import/specific/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/specific/input.ts.json @@ -31,7 +31,8 @@ "value": "Foo", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts new file mode 100644 index 000000000000..8810be942472 --- /dev/null +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts @@ -0,0 +1,9 @@ +import { type } from 'mod' +import { type foo } from 'mod' +import { type as } from 'mod' +import { type foo as bar } from 'mod' +import { type foo as as } from 'mod' +import { type as as } from 'mod' +import { type as foo } from 'mod' +import { type as as foo } from 'mod' +import { type as as as } from 'mod' diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json new file mode 100644 index 000000000000..3f6daabc38aa --- /dev/null +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json @@ -0,0 +1,479 @@ +{ + "type": "Module", + "span": { + "start": 0, + "end": 302, + "ctxt": 0 + }, + "body": [ + { + "type": "ImportDeclaration", + "span": { + "start": 0, + "end": 26, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 9, + "end": 13, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 9, + "end": 13, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 21, + "end": 26, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 27, + "end": 57, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 36, + "end": 44, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 41, + "end": 44, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "imported": null, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 52, + "end": 57, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 58, + "end": 87, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 67, + "end": 74, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 72, + "end": 74, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "imported": null, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 82, + "end": 87, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 88, + "end": 125, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 97, + "end": 112, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 109, + "end": 112, + "ctxt": 0 + }, + "value": "bar", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 102, + "end": 105, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 120, + "end": 125, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 126, + "end": 162, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 135, + "end": 149, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 147, + "end": 149, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 140, + "end": 143, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 157, + "end": 162, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 163, + "end": 195, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 172, + "end": 182, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 180, + "end": 182, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 172, + "end": 176, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 190, + "end": 195, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 196, + "end": 229, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 205, + "end": 209, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 213, + "end": 216, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 205, + "end": 209, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 224, + "end": 229, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 230, + "end": 266, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 239, + "end": 243, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 250, + "end": 253, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 244, + "end": 246, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 261, + "end": 266, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 267, + "end": 302, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 276, + "end": 280, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 287, + "end": 289, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 281, + "end": 283, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 297, + "end": 302, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} diff --git a/ecmascript/parser/tests/typescript/issue-913/input.ts.json b/ecmascript/parser/tests/typescript/issue-913/input.ts.json index b2c961cda4cc..c9496477c965 100644 --- a/ecmascript/parser/tests/typescript/issue-913/input.ts.json +++ b/ecmascript/parser/tests/typescript/issue-913/input.ts.json @@ -31,7 +31,8 @@ "value": "Rhum", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -120,7 +121,8 @@ "value": "Drash", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/async/es2017/asyncAwaitIsolatedModules_es2017/input.ts.json b/ecmascript/parser/tests/typescript/tsc/async/es2017/asyncAwaitIsolatedModules_es2017/input.ts.json index 0ed6ba8f46e8..6176f6fb16e0 100644 --- a/ecmascript/parser/tests/typescript/tsc/async/es2017/asyncAwaitIsolatedModules_es2017/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/async/es2017/asyncAwaitIsolatedModules_es2017/input.ts.json @@ -31,7 +31,8 @@ "value": "MyPromise", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/async/es5/asyncAwaitIsolatedModules_es5/input.ts.json b/ecmascript/parser/tests/typescript/tsc/async/es5/asyncAwaitIsolatedModules_es5/input.ts.json index e664ac766261..51add8017f2c 100644 --- a/ecmascript/parser/tests/typescript/tsc/async/es5/asyncAwaitIsolatedModules_es5/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/async/es5/asyncAwaitIsolatedModules_es5/input.ts.json @@ -31,7 +31,8 @@ "value": "MyPromise", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/async/es5/asyncImportedPromise_es5/input.ts.json b/ecmascript/parser/tests/typescript/tsc/async/es5/asyncImportedPromise_es5/input.ts.json index a5e00a5647cd..a11ca9aea0c1 100644 --- a/ecmascript/parser/tests/typescript/tsc/async/es5/asyncImportedPromise_es5/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/async/es5/asyncImportedPromise_es5/input.ts.json @@ -131,7 +131,8 @@ "value": "Task", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/async/es6/asyncAwaitIsolatedModules_es6/input.ts.json b/ecmascript/parser/tests/typescript/tsc/async/es6/asyncAwaitIsolatedModules_es6/input.ts.json index 9735c2bad24f..559801a25868 100644 --- a/ecmascript/parser/tests/typescript/tsc/async/es6/asyncAwaitIsolatedModules_es6/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/async/es6/asyncAwaitIsolatedModules_es6/input.ts.json @@ -31,7 +31,8 @@ "value": "MyPromise", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/async/es6/asyncImportedPromise_es6/input.ts.json b/ecmascript/parser/tests/typescript/tsc/async/es6/asyncImportedPromise_es6/input.ts.json index cfe84f5743de..3f1afa5c42e7 100644 --- a/ecmascript/parser/tests/typescript/tsc/async/es6/asyncImportedPromise_es6/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/async/es6/asyncImportedPromise_es6/input.ts.json @@ -131,7 +131,8 @@ "value": "Task", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/classes/members/privateNames/privateNamesUnique-2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/classes/members/privateNames/privateNamesUnique-2/input.ts.json index 8b312d3ed48e..820758e6167e 100644 --- a/ecmascript/parser/tests/typescript/tsc/classes/members/privateNames/privateNamesUnique-2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/classes/members/privateNames/privateNamesUnique-2/input.ts.json @@ -337,7 +337,8 @@ }, "value": "Foo", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -391,7 +392,8 @@ }, "value": "Foo", "optional": false - } + }, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportSpellingSuggestion/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportSpellingSuggestion/input.ts.json index 426cd442ecf4..02a944500817 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportSpellingSuggestion/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportSpellingSuggestion/input.ts.json @@ -212,7 +212,8 @@ "value": "assertNevar", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 c1d0709e060c..cc12e0af3993 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 @@ -488,7 +488,8 @@ "value": "x", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -507,7 +508,8 @@ "value": "y", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -526,7 +528,8 @@ "value": "z", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -545,7 +548,8 @@ "value": "foo", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 68566f551b5b..68db9a6f5675 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 @@ -488,7 +488,8 @@ "value": "x", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -507,7 +508,8 @@ "value": "y", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -526,7 +528,8 @@ "value": "z", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -545,7 +548,8 @@ "value": "foo", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 f467527ac056..af89e76a22d4 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 @@ -951,7 +951,8 @@ "value": "v", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -970,7 +971,8 @@ "value": "f", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -989,7 +991,8 @@ "value": "C", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1008,7 +1011,8 @@ "value": "I", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1027,7 +1031,8 @@ "value": "E", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1046,7 +1051,8 @@ "value": "D", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1065,7 +1071,8 @@ "value": "M", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1084,7 +1091,8 @@ "value": "N", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1103,7 +1111,8 @@ "value": "T", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1122,7 +1131,8 @@ "value": "a", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 994ac26e7f6d..b9613df62afa 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 @@ -951,7 +951,8 @@ "value": "v", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -970,7 +971,8 @@ "value": "f", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -989,7 +991,8 @@ "value": "C", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1008,7 +1011,8 @@ "value": "I", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1027,7 +1031,8 @@ "value": "E", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1046,7 +1051,8 @@ "value": "D", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1065,7 +1071,8 @@ "value": "M", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1084,7 +1091,8 @@ "value": "N", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1103,7 +1111,8 @@ "value": "T", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1122,7 +1131,8 @@ "value": "a", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 b92b1fdc5d6f..55352ae21f89 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 @@ -951,7 +951,8 @@ "value": "v", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -970,7 +971,8 @@ "value": "f", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -989,7 +991,8 @@ "value": "C", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1008,7 +1011,8 @@ "value": "I", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1027,7 +1031,8 @@ "value": "E", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1046,7 +1051,8 @@ "value": "D", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1065,7 +1071,8 @@ "value": "M", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1084,7 +1091,8 @@ "value": "N", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1103,7 +1111,8 @@ "value": "T", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1122,7 +1131,8 @@ "value": "a", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 97bd9639a801..cebedbf4fb99 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 @@ -221,7 +221,8 @@ "value": "x", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -240,7 +241,8 @@ "value": "y", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 201522b4983f..212e88a70be9 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 @@ -221,7 +221,8 @@ "value": "x", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -240,7 +241,8 @@ "value": "y", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 3ca2e9304afe..c460ff7acf8d 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 @@ -221,7 +221,8 @@ "value": "x", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -240,7 +241,8 @@ "value": "y", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 cea71e846779..61430ff79628 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 @@ -1212,7 +1212,8 @@ }, "value": "v1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1240,7 +1241,8 @@ }, "value": "f1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1268,7 +1270,8 @@ }, "value": "C1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1296,7 +1299,8 @@ }, "value": "I1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1324,7 +1328,8 @@ }, "value": "E1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1352,7 +1357,8 @@ }, "value": "D1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1380,7 +1386,8 @@ }, "value": "M1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1408,7 +1415,8 @@ }, "value": "N1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1436,7 +1444,8 @@ }, "value": "T1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1464,7 +1473,8 @@ }, "value": "a1", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 2105f8e40308..44d6e9288345 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 @@ -1212,7 +1212,8 @@ }, "value": "v1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1240,7 +1241,8 @@ }, "value": "f1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1268,7 +1270,8 @@ }, "value": "C1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1296,7 +1299,8 @@ }, "value": "I1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1324,7 +1328,8 @@ }, "value": "E1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1352,7 +1357,8 @@ }, "value": "D1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1380,7 +1386,8 @@ }, "value": "M1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1408,7 +1415,8 @@ }, "value": "N1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1436,7 +1444,8 @@ }, "value": "T1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1464,7 +1473,8 @@ }, "value": "a1", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 5722b8074442..f06a3615e947 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 @@ -1212,7 +1212,8 @@ }, "value": "v1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1240,7 +1241,8 @@ }, "value": "f1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1268,7 +1270,8 @@ }, "value": "C1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1296,7 +1299,8 @@ }, "value": "I1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1324,7 +1328,8 @@ }, "value": "E1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1352,7 +1357,8 @@ }, "value": "D1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1380,7 +1386,8 @@ }, "value": "M1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1408,7 +1415,8 @@ }, "value": "N1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1436,7 +1444,8 @@ }, "value": "T1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -1464,7 +1473,8 @@ }, "value": "a1", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 ada497ac1e76..3cd545f2d285 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 @@ -285,7 +285,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -492,7 +493,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -830,7 +832,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -1037,7 +1040,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 9d4838526a52..5ffabf918896 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 @@ -285,7 +285,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -492,7 +493,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -830,7 +832,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -1037,7 +1040,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 9d4838526a52..5ffabf918896 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 @@ -285,7 +285,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -492,7 +493,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -830,7 +832,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -1037,7 +1040,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 b0a19fa1131f..490e1867d878 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 @@ -307,7 +307,8 @@ }, "value": "as", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -352,7 +353,8 @@ "value": "as", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithUnderscores4/input.ts.json b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithUnderscores4/input.ts.json index bac064e8fab9..1c90023ba55a 100644 --- a/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithUnderscores4/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/es6/modules/exportsAndImportsWithUnderscores4/input.ts.json @@ -836,7 +836,8 @@ "value": "_", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -855,7 +856,8 @@ "value": "__", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -874,7 +876,8 @@ "value": "___hello", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -893,7 +896,8 @@ "value": "__esmodule", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -912,7 +916,8 @@ "value": "__proto", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -931,7 +936,8 @@ "value": "_hi", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 998b3ac27e37..856453e34594 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 @@ -148,7 +148,8 @@ "value": "f", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/expressions/asOperator/asOperator4/input.ts.json b/ecmascript/parser/tests/typescript/tsc/expressions/asOperator/asOperator4/input.ts.json index 2665fc7895e8..b1e5d1be9f08 100644 --- a/ecmascript/parser/tests/typescript/tsc/expressions/asOperator/asOperator4/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/expressions/asOperator/asOperator4/input.ts.json @@ -73,7 +73,8 @@ "value": "foo", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 563bce0812d6..ca844590c0f0 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 @@ -75,7 +75,8 @@ "value": "a", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 563bce0812d6..ca844590c0f0 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 @@ -75,7 +75,8 @@ "value": "a", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 9195ece6ec70..5d4c1ed92282 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json @@ -373,7 +373,8 @@ "value": "a", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 5c4e5cf025a4..2815994926ad 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json @@ -153,7 +153,8 @@ "value": "x", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -172,7 +173,8 @@ "value": "y", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/ambient/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/ambient/input.ts.json index 570c3676ffa8..5b2e7d24658c 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/ambient/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/ambient/input.ts.json @@ -112,7 +112,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 e2fcaba74661..11fc30451bbc 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 @@ -201,7 +201,8 @@ }, "value": "Z", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -300,7 +301,8 @@ "value": "C", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -386,7 +388,8 @@ "value": "D", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 3500afdd2043..b0cb76b77b31 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 @@ -198,7 +198,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular2/input.ts.json index c4d301e7a410..db2f4d6a22f3 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular2/input.ts.json @@ -31,7 +31,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -123,7 +124,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 4e77ef66a04d..92ab527873b9 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 @@ -31,7 +31,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -117,7 +118,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular4/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular4/input.ts.json index 9785ed975da1..62eaaab95c3b 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular4/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/circular4/input.ts.json @@ -31,7 +31,8 @@ "value": "ns2", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -225,7 +226,8 @@ "value": "ns1", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 bc0d7a810795..f72ac6dba357 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 @@ -89,7 +89,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 eb9fa17b655e..e2d0779cd481 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 @@ -110,7 +110,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 86dc0efe6849..9f3bdd0e527f 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 @@ -133,7 +133,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 a6acbd9426fa..29ed8f2d96e2 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 @@ -154,7 +154,8 @@ "value": "a", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 05f68bd73b3a..f4400792aa6d 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 @@ -192,7 +192,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -237,7 +238,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importClause_namedImports/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importClause_namedImports/input.ts.json index abac57af2b0e..9159e1c68ca5 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importClause_namedImports/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importClause_namedImports/input.ts.json @@ -198,7 +198,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -217,7 +218,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -236,7 +238,8 @@ "value": "C", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importsNotUsedAsValues_error/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importsNotUsedAsValues_error/input.ts.json index 6ad5b2adcc69..b905536eca43 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importsNotUsedAsValues_error/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/importsNotUsedAsValues_error/input.ts.json @@ -194,7 +194,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -213,7 +214,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -735,7 +737,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -955,7 +958,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -974,7 +978,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -1019,7 +1024,8 @@ "value": "C", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -1073,7 +1079,8 @@ }, "value": "C", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -1416,7 +1423,8 @@ "value": "C", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 61ccfc10e0dd..6a287a564f1b 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 @@ -208,7 +208,8 @@ }, "value": "C", "optional": false - } + }, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/typeQuery/input.ts.json b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/typeQuery/input.ts.json index 093b5123c716..addc9dea333a 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/typeQuery/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/typeOnly/typeQuery/input.ts.json @@ -65,7 +65,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 ffe543c269be..c9bed35f5080 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 @@ -431,7 +431,8 @@ "value": "Base", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 cc964d91ccf1..e34b1362d35d 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 @@ -176,7 +176,8 @@ "value": "Foo", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses/input.ts.json index d5cc2cf80220..3e20f5bf232b 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses/input.ts.json @@ -341,7 +341,8 @@ "value": "Point", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses2/input.ts.json index 05566abe6dfd..dfefb75b8328 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsFunctionLikeClasses2/input.ts.json @@ -2054,7 +2054,8 @@ "value": "Point2D", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 900b9de756da..a0001224dc0a 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 @@ -104,7 +104,8 @@ "value": "myTypes", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportNamespacedType/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportNamespacedType/input.ts.json index 27ada3812f71..7853cbc2f31a 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportNamespacedType/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/declarations/jsDeclarationsImportNamespacedType/input.ts.json @@ -31,7 +31,8 @@ "value": "dummy", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 6297ad0c2971..aa7a61e89ff6 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 @@ -73,7 +73,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 f51b52789d23..b35414a150ff 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 @@ -122,7 +122,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/enumTagImported/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/enumTagImported/input.ts.json index 7ffab3c267f5..ae4ca7cc89e1 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/enumTagImported/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/enumTagImported/input.ts.json @@ -123,7 +123,8 @@ "value": "TestEnum", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/extendsTagEmit/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/extendsTagEmit/input.ts.json index 918035e1c777..36549af2abd2 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/extendsTagEmit/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/extendsTagEmit/input.ts.json @@ -65,7 +65,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsdoc/noAssertForUnparseableTypedefs/input.ts.json b/ecmascript/parser/tests/typescript/tsc/jsdoc/noAssertForUnparseableTypedefs/input.ts.json index 84247644c055..28a7c8e52b00 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsdoc/noAssertForUnparseableTypedefs/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/jsdoc/noAssertForUnparseableTypedefs/input.ts.json @@ -31,7 +31,8 @@ "value": "nope", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptionsx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptionsx/input.tsx.json index 3025adaa0ffe..9ee66fe37f99 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptionsx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmaOverridesCompilerOptionsx/input.tsx.json @@ -428,7 +428,8 @@ "value": "createElement", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -447,7 +448,8 @@ "value": "Fragment", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -574,7 +576,8 @@ "value": "h", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -593,7 +596,8 @@ "value": "Frag", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -720,7 +724,8 @@ "value": "h", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -847,7 +852,8 @@ "value": "h", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -892,7 +898,8 @@ "value": "Fragment", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmax/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmax/input.tsx.json index d1eeb9ce98c1..5b4a726cc126 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmax/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxAndJsxFragPragmax/input.tsx.json @@ -328,7 +328,8 @@ "value": "h", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -347,7 +348,8 @@ "value": "Fragment", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -474,7 +476,8 @@ "value": "jsx", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryDeclarationsLocalTypesx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryDeclarationsLocalTypesx/input.tsx.json index 4f419d6edff6..2ece417bf885 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryDeclarationsLocalTypesx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryDeclarationsLocalTypesx/input.tsx.json @@ -1349,7 +1349,8 @@ "value": "predom", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -3125,7 +3126,8 @@ "value": "dom", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -3188,7 +3190,8 @@ "value": "MySFC", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -3207,7 +3210,8 @@ "value": "MyClass", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -3226,7 +3230,8 @@ "value": "tree", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallbackx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallbackx/input.tsx.json index f8067329e557..659c6bbea77c 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallbackx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryLocalTypeGlobalFallbackx/input.tsx.json @@ -1124,7 +1124,8 @@ "value": "predom", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -1225,7 +1226,8 @@ "value": "dom", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { 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 9b47a3efb6f7..d19b3aea6ff4 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 @@ -269,7 +269,8 @@ "value": "dom", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -370,7 +371,8 @@ "value": "p", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryWithFragmentIsErrorx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryWithFragmentIsErrorx/input.tsx.json index 781435e808ed..5900fc4c2ab0 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryWithFragmentIsErrorx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/inline/inlineJsxFactoryWithFragmentIsErrorx/input.tsx.json @@ -404,7 +404,8 @@ "value": "dom", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/jsxCheckJsxNoTypeArgumentsAllowedx/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/jsxCheckJsxNoTypeArgumentsAllowedx/input.tsx.json index 75e835349f16..db391217657b 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/jsxCheckJsxNoTypeArgumentsAllowedx/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/jsxCheckJsxNoTypeArgumentsAllowedx/input.tsx.json @@ -381,7 +381,8 @@ "value": "MyComp", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -400,7 +401,8 @@ "value": "Prop", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/tsxElementResolution19x/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/tsxElementResolution19x/input.tsx.json index 1c71a91c60f1..a0079894f071 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/tsxElementResolution19x/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/tsxElementResolution19x/input.tsx.json @@ -202,7 +202,8 @@ "value": "MyClass", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/tsxExternalModuleEmit1x/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/tsxExternalModuleEmit1x/input.tsx.json index f5db1e03538f..a1cff408e286 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/tsxExternalModuleEmit1x/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/tsxExternalModuleEmit1x/input.tsx.json @@ -184,7 +184,8 @@ "value": "Button", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/tsxPreserveEmit3x/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/tsxPreserveEmit3x/input.tsx.json index a2f9c5f88969..0380ce0ee883 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/tsxPreserveEmit3x/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/tsxPreserveEmit3x/input.tsx.json @@ -219,7 +219,8 @@ "value": "React", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/jsx/tsxReactEmit5x/input.tsx.json b/ecmascript/parser/tests/typescript/tsc/jsx/tsxReactEmit5x/input.tsx.json index 5713cf75e67c..c1c172962419 100644 --- a/ecmascript/parser/tests/typescript/tsc/jsx/tsxReactEmit5x/input.tsx.json +++ b/ecmascript/parser/tests/typescript/tsc/jsx/tsxReactEmit5x/input.tsx.json @@ -219,7 +219,8 @@ "value": "React", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/moduleResolution/scopedPackagesClassic/input.ts.json b/ecmascript/parser/tests/typescript/tsc/moduleResolution/scopedPackagesClassic/input.ts.json index 0177ba52ba0f..74ea6af5df8b 100644 --- a/ecmascript/parser/tests/typescript/tsc/moduleResolution/scopedPackagesClassic/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/moduleResolution/scopedPackagesClassic/input.ts.json @@ -80,7 +80,8 @@ "value": "x", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/salsa/assignmentToVoidZero2/input.ts.json b/ecmascript/parser/tests/typescript/tsc/salsa/assignmentToVoidZero2/input.ts.json index 7d8803a886b8..5d9832649d93 100644 --- a/ecmascript/parser/tests/typescript/tsc/salsa/assignmentToVoidZero2/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/salsa/assignmentToVoidZero2/input.ts.json @@ -662,7 +662,8 @@ "value": "j", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -681,7 +682,8 @@ "value": "k", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/salsa/conflictingCommonJSES2015Exports/input.ts.json b/ecmascript/parser/tests/typescript/tsc/salsa/conflictingCommonJSES2015Exports/input.ts.json index a90152c9cacd..b23056b57674 100644 --- a/ecmascript/parser/tests/typescript/tsc/salsa/conflictingCommonJSES2015Exports/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/salsa/conflictingCommonJSES2015Exports/input.ts.json @@ -218,7 +218,8 @@ "value": "abc", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/salsa/expandoOnAlias/input.ts.json b/ecmascript/parser/tests/typescript/tsc/salsa/expandoOnAlias/input.ts.json index ef403c26da73..86f20fd88cbe 100644 --- a/ecmascript/parser/tests/typescript/tsc/salsa/expandoOnAlias/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/salsa/expandoOnAlias/input.ts.json @@ -137,7 +137,8 @@ "value": "Vue", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false }, { "type": "ImportSpecifier", @@ -156,7 +157,8 @@ "value": "config", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/salsa/propertyAssignmentOnImportedSymbol/input.ts.json b/ecmascript/parser/tests/typescript/tsc/salsa/propertyAssignmentOnImportedSymbol/input.ts.json index 45ec9daf6d36..3b9e0c8d3fbd 100644 --- a/ecmascript/parser/tests/typescript/tsc/salsa/propertyAssignmentOnImportedSymbol/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/salsa/propertyAssignmentOnImportedSymbol/input.ts.json @@ -80,7 +80,8 @@ "value": "hurk", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/parser/tests/typescript/tsc/typings/typingsLookupAmd/input.ts.json b/ecmascript/parser/tests/typescript/tsc/typings/typingsLookupAmd/input.ts.json index b669bd13ac08..7588b1c0ed39 100644 --- a/ecmascript/parser/tests/typescript/tsc/typings/typingsLookupAmd/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/typings/typingsLookupAmd/input.ts.json @@ -65,7 +65,8 @@ "value": "A", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { @@ -153,7 +154,8 @@ "value": "B", "optional": false }, - "imported": null + "imported": null, + "isTypeOnly": false } ], "source": { diff --git a/ecmascript/transforms/react/src/jsx/mod.rs b/ecmascript/transforms/react/src/jsx/mod.rs index fd5c5db83555..139a9a579f70 100644 --- a/ecmascript/transforms/react/src/jsx/mod.rs +++ b/ecmascript/transforms/react/src/jsx/mod.rs @@ -797,6 +797,7 @@ where span: DUMMY_SP, local, imported: Some(Ident::new("createElement".into(), DUMMY_SP)), + is_type_only: false, }); prepend( &mut module.body, @@ -822,12 +823,14 @@ where span: DUMMY_SP, local, imported: Some(quote_ident!("jsx")), + is_type_only: false, }) .into_iter() .chain(self.import_jsxs.take().map(|local| ImportNamedSpecifier { span: DUMMY_SP, local, imported: Some(quote_ident!("jsxs")), + is_type_only: false, })) .chain( self.import_fragment @@ -836,6 +839,7 @@ where span: DUMMY_SP, local, imported: Some(quote_ident!("Fragment")), + is_type_only: false, }), ) .map(ImportSpecifier::Named) diff --git a/ecmascript/visit/src/lib.rs b/ecmascript/visit/src/lib.rs index 448bbae8e39c..1fccb0a33634 100644 --- a/ecmascript/visit/src/lib.rs +++ b/ecmascript/visit/src/lib.rs @@ -1036,6 +1036,7 @@ define!({ pub span: Span, pub local: Ident, pub imported: Option, + pub is_type_only: bool, } pub enum ExportSpecifier { Namespace(ExportNamespaceSpecifier), From c00df7859b3153ad5b3b7911ba90ebffc45eca38 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 25 Sep 2021 23:20:43 +0800 Subject: [PATCH 02/17] add more tests --- .../parser/src/parser/stmt/module_item.rs | 8 + .../invalid-local/input.ts | 1 + .../invalid-local/input.ts.stderr | 6 + .../input.ts | 1 + .../input.ts.stderr | 6 + .../invalid-type-only/input.ts | 1 + .../invalid-type-only/input.ts.stderr | 6 + .../type-only-specifier/missing-as/input.ts | 1 + .../missing-as/input.ts.stderr | 6 + .../missing-local/input.ts | 1 + .../missing-local/input.ts.stderr | 6 + .../redundant-tokens/input.ts | 1 + .../redundant-tokens/input.ts.stderr | 6 + .../type-only-specifier/too-many-as/input.ts | 1 + .../too-many-as/input.ts.stderr | 6 + .../import/type-only-specifier/input.ts | 2 + .../import/type-only-specifier/input.ts.json | 146 +++++++++++++++--- 17 files changed, 187 insertions(+), 18 deletions(-) create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index ba2f1f5c4182..198982e52abf 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -198,6 +198,14 @@ impl<'a, I: Tokens> Parser { if possibly_orgi_name.sym == js_word!("as") { // `import { type as } from 'mod'` if !is!(self, IdentName) { + if self.ctx().is_reserved_word(&possibly_orgi_name.sym) { + syntax_error!( + self, + possibly_orgi_name.span, + SyntaxError::ReservedWordInImport + ) + } + return Ok(ImportSpecifier::Named(ImportNamedSpecifier { span: span!(self, start), local: possibly_orgi_name, diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts new file mode 100644 index 000000000000..659ea34cf8e4 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts @@ -0,0 +1 @@ +import { type as export } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts.stderr new file mode 100644 index 000000000000..10b7142f8911 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ident + --> $DIR/tests/typescript-errors/type-only-specifier/invalid-local/input.ts:1:18 + | +1 | import { type as export } from 'mod' + | ^^^^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts new file mode 100644 index 000000000000..60eb97e2fc49 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts @@ -0,0 +1 @@ +import { type as as export } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts.stderr new file mode 100644 index 000000000000..75cef3a1e687 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ident + --> $DIR/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts:1:21 + | +1 | import { type as as export } from 'mod' + | ^^^^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts new file mode 100644 index 000000000000..b9f4c6042c90 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts @@ -0,0 +1 @@ +import { type import } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts.stderr new file mode 100644 index 000000000000..b4c81a106b24 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts.stderr @@ -0,0 +1,6 @@ +error: cannot import as reserved word + --> $DIR/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts:1:15 + | +1 | import { type import } from 'mod' + | ^^^^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts new file mode 100644 index 000000000000..ebe715adcb3b --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts @@ -0,0 +1 @@ +import { type foo bar } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr new file mode 100644 index 000000000000..d2fd7f4381ee --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ,, got bar + --> $DIR/tests/typescript-errors/type-only-specifier/missing-as/input.ts:1:19 + | +1 | import { type foo bar } from 'mod' + | ^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts new file mode 100644 index 000000000000..c8d9eebe9c54 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts @@ -0,0 +1 @@ +import { type foo as } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts.stderr new file mode 100644 index 000000000000..d3a75131552d --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ident + --> $DIR/tests/typescript-errors/type-only-specifier/missing-local/input.ts:1:22 + | +1 | import { type foo as } from 'mod' + | ^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts new file mode 100644 index 000000000000..6c2c9b13e486 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts @@ -0,0 +1 @@ +import { type foo as bar baz } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr new file mode 100644 index 000000000000..7c69fb1840b7 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ,, got baz + --> $DIR/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts:1:26 + | +1 | import { type foo as bar baz } from 'mod' + | ^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts new file mode 100644 index 000000000000..c429dc5b3f2c --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts @@ -0,0 +1 @@ +import { type as as as as } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr new file mode 100644 index 000000000000..fbfc7777c43c --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ,, got as + --> $DIR/tests/typescript-errors/type-only-specifier/too-many-as/input.ts:1:24 + | +1 | import { type as as as as } from 'mod' + | ^^ + diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts index 8810be942472..71ca0cf10761 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts @@ -5,5 +5,7 @@ import { type foo as bar } from 'mod' import { type foo as as } from 'mod' import { type as as } from 'mod' import { type as foo } from 'mod' +import { type as type } from 'mod' import { type as as foo } from 'mod' import { type as as as } from 'mod' +import { type type as as } from 'mod' diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json index 3f6daabc38aa..c181f5672227 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json @@ -2,7 +2,7 @@ "type": "Module", "span": { "start": 0, - "end": 302, + "end": 375, "ctxt": 0 }, "body": [ @@ -368,7 +368,7 @@ "type": "ImportDeclaration", "span": { "start": 230, - "end": 266, + "end": 264, "ctxt": 0 }, "specifiers": [ @@ -382,8 +382,63 @@ "local": { "type": "Identifier", "span": { - "start": 250, - "end": 253, + "start": 247, + "end": 251, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 239, + "end": 243, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 259, + "end": 264, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 265, + "end": 301, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 274, + "end": 278, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 285, + "end": 288, "ctxt": 0 }, "value": "foo", @@ -392,8 +447,8 @@ "imported": { "type": "Identifier", "span": { - "start": 244, - "end": 246, + "start": 279, + "end": 281, "ctxt": 0 }, "value": "as", @@ -405,8 +460,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 261, - "end": 266, + "start": 296, + "end": 301, "ctxt": 0 }, "value": "mod", @@ -422,23 +477,23 @@ { "type": "ImportDeclaration", "span": { - "start": 267, - "end": 302, + "start": 302, + "end": 337, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 276, - "end": 280, + "start": 311, + "end": 315, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 287, - "end": 289, + "start": 322, + "end": 324, "ctxt": 0 }, "value": "as", @@ -447,8 +502,8 @@ "imported": { "type": "Identifier", "span": { - "start": 281, - "end": 283, + "start": 316, + "end": 318, "ctxt": 0 }, "value": "as", @@ -460,8 +515,63 @@ "source": { "type": "StringLiteral", "span": { - "start": 297, - "end": 302, + "start": 332, + "end": 337, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": false, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 338, + "end": 375, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 347, + "end": 362, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 360, + "end": 362, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "imported": { + "type": "Identifier", + "span": { + "start": 352, + "end": 356, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 370, + "end": 375, "ctxt": 0 }, "value": "mod", From 6cec491cea57bfac9bc49d9c939a3204e7eb7b93 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 25 Sep 2021 23:43:21 +0800 Subject: [PATCH 03/17] disallow duplicated "type-only" --- ecmascript/parser/src/parser/stmt/module_item.rs | 6 ++++-- .../type-only-specifier/duplicated-type-only/input.ts | 1 + .../duplicated-type-only/input.ts.stderr | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index 198982e52abf..4fc800e94c31 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -119,7 +119,7 @@ impl<'a, I: Tokens> Parser { })); } else if eat!(self, '{') { while !eof!(self) && !is!(self, '}') { - specifiers.push(self.parse_import_specifier()?); + specifiers.push(self.parse_import_specifier(type_only)?); if is!(self, '}') { break; @@ -177,7 +177,7 @@ impl<'a, I: Tokens> Parser { } /// Parse `foo`, `foo2 as bar` in `import { foo, foo2 as bar }` - fn parse_import_specifier(&mut self) -> PResult { + fn parse_import_specifier(&mut self, is_type_only_import: bool) -> PResult { let start = cur_pos!(self); match cur!(self, false) { Ok(&Word(..)) => { @@ -193,6 +193,8 @@ impl<'a, I: Tokens> Parser { if orig_name.sym == js_word!("type") && is!(self, IdentName) && self.syntax().typescript() + // invalid: `import type { type something } from 'mod'` + && !is_type_only_import { let possibly_orgi_name = self.parse_ident_name()?; if possibly_orgi_name.sym == js_word!("as") { diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts new file mode 100644 index 000000000000..4c8330f871bf --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts @@ -0,0 +1 @@ +import type { type something } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr new file mode 100644 index 000000000000..2e57e2a1b605 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ,, got something + --> $DIR/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts:1:20 + | +1 | import type { type something } from 'mod' + | ^^^^^^^^^ + From b884d3bbd3f4b1e7951c5bac8d754338d2d8629e Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sat, 25 Sep 2021 23:51:47 +0800 Subject: [PATCH 04/17] add more tests --- .../import/type-only-specifier/input.ts | 1 + .../import/type-only-specifier/input.ts.json | 236 +++++++++++------- 2 files changed, 142 insertions(+), 95 deletions(-) diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts index 71ca0cf10761..9cec2955644b 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts @@ -1,4 +1,5 @@ import { type } from 'mod' +import type { type } from 'mod' import { type foo } from 'mod' import { type as } from 'mod' import { type foo as bar } from 'mod' diff --git a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json index c181f5672227..a95e18fce113 100644 --- a/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json +++ b/ecmascript/parser/tests/typescript/custom/type-only/import/type-only-specifier/input.ts.json @@ -2,7 +2,7 @@ "type": "Module", "span": { "start": 0, - "end": 375, + "end": 407, "ctxt": 0 }, "body": [ @@ -56,22 +56,68 @@ "type": "ImportDeclaration", "span": { "start": 27, - "end": 57, + "end": 58, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 36, - "end": 44, + "start": 41, + "end": 45, "ctxt": 0 }, "local": { "type": "Identifier", "span": { "start": 41, - "end": 44, + "end": 45, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "imported": null, + "isTypeOnly": false + } + ], + "source": { + "type": "StringLiteral", + "span": { + "start": 53, + "end": 58, + "ctxt": 0 + }, + "value": "mod", + "hasEscape": false, + "kind": { + "type": "normal", + "containsQuote": true + } + }, + "typeOnly": true, + "asserts": null + }, + { + "type": "ImportDeclaration", + "span": { + "start": 59, + "end": 89, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ImportSpecifier", + "span": { + "start": 68, + "end": 76, + "ctxt": 0 + }, + "local": { + "type": "Identifier", + "span": { + "start": 73, + "end": 76, "ctxt": 0 }, "value": "foo", @@ -84,8 +130,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 52, - "end": 57, + "start": 84, + "end": 89, "ctxt": 0 }, "value": "mod", @@ -101,23 +147,23 @@ { "type": "ImportDeclaration", "span": { - "start": 58, - "end": 87, + "start": 90, + "end": 119, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 67, - "end": 74, + "start": 99, + "end": 106, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 72, - "end": 74, + "start": 104, + "end": 106, "ctxt": 0 }, "value": "as", @@ -130,8 +176,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 82, - "end": 87, + "start": 114, + "end": 119, "ctxt": 0 }, "value": "mod", @@ -147,23 +193,23 @@ { "type": "ImportDeclaration", "span": { - "start": 88, - "end": 125, + "start": 120, + "end": 157, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 97, - "end": 112, + "start": 129, + "end": 144, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 109, - "end": 112, + "start": 141, + "end": 144, "ctxt": 0 }, "value": "bar", @@ -172,8 +218,8 @@ "imported": { "type": "Identifier", "span": { - "start": 102, - "end": 105, + "start": 134, + "end": 137, "ctxt": 0 }, "value": "foo", @@ -185,8 +231,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 120, - "end": 125, + "start": 152, + "end": 157, "ctxt": 0 }, "value": "mod", @@ -202,23 +248,23 @@ { "type": "ImportDeclaration", "span": { - "start": 126, - "end": 162, + "start": 158, + "end": 194, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 135, - "end": 149, + "start": 167, + "end": 181, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 147, - "end": 149, + "start": 179, + "end": 181, "ctxt": 0 }, "value": "as", @@ -227,8 +273,8 @@ "imported": { "type": "Identifier", "span": { - "start": 140, - "end": 143, + "start": 172, + "end": 175, "ctxt": 0 }, "value": "foo", @@ -240,8 +286,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 157, - "end": 162, + "start": 189, + "end": 194, "ctxt": 0 }, "value": "mod", @@ -257,23 +303,23 @@ { "type": "ImportDeclaration", "span": { - "start": 163, - "end": 195, + "start": 195, + "end": 227, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 172, - "end": 182, + "start": 204, + "end": 214, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 180, - "end": 182, + "start": 212, + "end": 214, "ctxt": 0 }, "value": "as", @@ -282,8 +328,8 @@ "imported": { "type": "Identifier", "span": { - "start": 172, - "end": 176, + "start": 204, + "end": 208, "ctxt": 0 }, "value": "type", @@ -295,8 +341,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 190, - "end": 195, + "start": 222, + "end": 227, "ctxt": 0 }, "value": "mod", @@ -312,23 +358,23 @@ { "type": "ImportDeclaration", "span": { - "start": 196, - "end": 229, + "start": 228, + "end": 261, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 205, - "end": 209, + "start": 237, + "end": 241, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 213, - "end": 216, + "start": 245, + "end": 248, "ctxt": 0 }, "value": "foo", @@ -337,8 +383,8 @@ "imported": { "type": "Identifier", "span": { - "start": 205, - "end": 209, + "start": 237, + "end": 241, "ctxt": 0 }, "value": "type", @@ -350,8 +396,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 224, - "end": 229, + "start": 256, + "end": 261, "ctxt": 0 }, "value": "mod", @@ -367,23 +413,23 @@ { "type": "ImportDeclaration", "span": { - "start": 230, - "end": 264, + "start": 262, + "end": 296, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 239, - "end": 243, + "start": 271, + "end": 275, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 247, - "end": 251, + "start": 279, + "end": 283, "ctxt": 0 }, "value": "type", @@ -392,8 +438,8 @@ "imported": { "type": "Identifier", "span": { - "start": 239, - "end": 243, + "start": 271, + "end": 275, "ctxt": 0 }, "value": "type", @@ -405,8 +451,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 259, - "end": 264, + "start": 291, + "end": 296, "ctxt": 0 }, "value": "mod", @@ -422,23 +468,23 @@ { "type": "ImportDeclaration", "span": { - "start": 265, - "end": 301, + "start": 297, + "end": 333, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 274, - "end": 278, + "start": 306, + "end": 310, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 285, - "end": 288, + "start": 317, + "end": 320, "ctxt": 0 }, "value": "foo", @@ -447,8 +493,8 @@ "imported": { "type": "Identifier", "span": { - "start": 279, - "end": 281, + "start": 311, + "end": 313, "ctxt": 0 }, "value": "as", @@ -460,8 +506,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 296, - "end": 301, + "start": 328, + "end": 333, "ctxt": 0 }, "value": "mod", @@ -477,23 +523,23 @@ { "type": "ImportDeclaration", "span": { - "start": 302, - "end": 337, + "start": 334, + "end": 369, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 311, - "end": 315, + "start": 343, + "end": 347, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 322, - "end": 324, + "start": 354, + "end": 356, "ctxt": 0 }, "value": "as", @@ -502,8 +548,8 @@ "imported": { "type": "Identifier", "span": { - "start": 316, - "end": 318, + "start": 348, + "end": 350, "ctxt": 0 }, "value": "as", @@ -515,8 +561,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 332, - "end": 337, + "start": 364, + "end": 369, "ctxt": 0 }, "value": "mod", @@ -532,23 +578,23 @@ { "type": "ImportDeclaration", "span": { - "start": 338, - "end": 375, + "start": 370, + "end": 407, "ctxt": 0 }, "specifiers": [ { "type": "ImportSpecifier", "span": { - "start": 347, - "end": 362, + "start": 379, + "end": 394, "ctxt": 0 }, "local": { "type": "Identifier", "span": { - "start": 360, - "end": 362, + "start": 392, + "end": 394, "ctxt": 0 }, "value": "as", @@ -557,8 +603,8 @@ "imported": { "type": "Identifier", "span": { - "start": 352, - "end": 356, + "start": 384, + "end": 388, "ctxt": 0 }, "value": "type", @@ -570,8 +616,8 @@ "source": { "type": "StringLiteral", "span": { - "start": 370, - "end": 375, + "start": 402, + "end": 407, "ctxt": 0 }, "value": "mod", From bf2d3f11967ca17afca38cde0569acb5a96312f3 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 26 Sep 2021 09:32:58 +0800 Subject: [PATCH 05/17] rebase --- .../type-only-specifier/duplicated-type-only/input.ts.stderr | 2 +- .../type-only-specifier/missing-as/input.ts.stderr | 2 +- .../type-only-specifier/redundant-tokens/input.ts.stderr | 2 +- .../type-only-specifier/too-many-as/input.ts.stderr | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr index 2e57e2a1b605..8596f0431af0 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr @@ -1,4 +1,4 @@ -error: Expected ,, got something +error: Expected ',', got 'something' --> $DIR/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts:1:20 | 1 | import type { type something } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr index d2fd7f4381ee..6c3e5584dcfe 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr @@ -1,4 +1,4 @@ -error: Expected ,, got bar +error: Expected ',', got 'bar' --> $DIR/tests/typescript-errors/type-only-specifier/missing-as/input.ts:1:19 | 1 | import { type foo bar } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr index 7c69fb1840b7..5549a5715e27 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr @@ -1,4 +1,4 @@ -error: Expected ,, got baz +error: Expected ',', got 'baz' --> $DIR/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts:1:26 | 1 | import { type foo as bar baz } from 'mod' diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr index fbfc7777c43c..1b81cb1e3780 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr @@ -1,4 +1,4 @@ -error: Expected ,, got as +error: Expected ',', got 'as' --> $DIR/tests/typescript-errors/type-only-specifier/too-many-as/input.ts:1:24 | 1 | import { type as as as as } from 'mod' From aebc02ebeca6292089390f9bf8a4f334e86bd5ad Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 26 Sep 2021 10:17:31 +0800 Subject: [PATCH 06/17] don't emit type-only specifier --- ecmascript/codegen/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs index 35683577fcf2..9f7d5bd521d8 100644 --- a/ecmascript/codegen/src/lib.rs +++ b/ecmascript/codegen/src/lib.rs @@ -184,7 +184,9 @@ impl<'a> Emitter<'a> { for specifier in &node.specifiers { match specifier { ImportSpecifier::Named(ref s) => { - specifiers.push(s); + if !s.is_type_only { + specifiers.push(s); + } } ImportSpecifier::Default(ref s) => { emit!(s.local); From 6ae14a1e43ca9a73ce809067256c0db0f63b9fc8 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 26 Sep 2021 10:24:12 +0800 Subject: [PATCH 07/17] fix babel compat --- ecmascript/babel/compat/src/babelify/module_decl.rs | 6 +++++- ecmascript/babel/compat/src/swcify/stmt.rs | 9 +++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ecmascript/babel/compat/src/babelify/module_decl.rs b/ecmascript/babel/compat/src/babelify/module_decl.rs index c208a7d75600..b0d57b8c244f 100644 --- a/ecmascript/babel/compat/src/babelify/module_decl.rs +++ b/ecmascript/babel/compat/src/babelify/module_decl.rs @@ -265,7 +265,11 @@ impl Babelify for ImportNamedSpecifier { base: ctx.base(self.span), local: self.local.clone().babelify(ctx), imported: IdOrString::Id(self.imported.unwrap_or(self.local).babelify(ctx)), - import_kind: None, + import_kind: if self.is_type_only { + Some(ImportKind::Type) + } else { + None + }, } } } diff --git a/ecmascript/babel/compat/src/swcify/stmt.rs b/ecmascript/babel/compat/src/swcify/stmt.rs index dff70944b04d..060d4129b15b 100644 --- a/ecmascript/babel/compat/src/swcify/stmt.rs +++ b/ecmascript/babel/compat/src/swcify/stmt.rs @@ -7,10 +7,10 @@ use swc_babel_ast::{ DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclType, ExportDefaultDeclaration, ExportNamedDeclaration, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, ForStmtInit, ForStmtLeft, FunctionDeclaration, IdOrString, - IfStatement, ImportAttribute, ImportDeclaration, ImportNamespaceSpecifier, ImportSpecifierType, - LabeledStatement, ReturnStatement, Statement, SwitchStatement, ThrowStatement, TryStatement, - VariableDeclaration, VariableDeclarationKind, VariableDeclarator, WhileStatement, - WithStatement, + IfStatement, ImportAttribute, ImportDeclaration, ImportKind, ImportNamespaceSpecifier, + ImportSpecifierType, LabeledStatement, ReturnStatement, Statement, SwitchStatement, + ThrowStatement, TryStatement, VariableDeclaration, VariableDeclarationKind, VariableDeclarator, + WhileStatement, WithStatement, }; use swc_common::DUMMY_SP; use swc_ecma_ast::{ @@ -655,6 +655,7 @@ impl Swcify for swc_babel_ast::ImportSpecifier { span: ctx.span(&self.base), local: self.local.swcify(ctx).id, imported: Some(self.imported.swcify(ctx).expect_ident()), + is_type_only: matches!(self.import_kind, Some(ImportKind::Type)), } } } From f9fad5198c8e7ea632f390d42a92891b9fcb9a44 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 26 Sep 2021 11:43:36 +0800 Subject: [PATCH 08/17] rename tests path --- .../duplicated-type-only/input.ts | 0 .../duplicated-type-only/input.ts.stderr | 0 .../invalid-local/input.ts | 0 .../invalid-local/input.ts.stderr | 0 .../invalid-type-only-local-with-imported/input.ts | 0 .../invalid-type-only-local-with-imported/input.ts.stderr | 0 .../invalid-type-only/input.ts | 0 .../invalid-type-only/input.ts.stderr | 0 .../missing-as/input.ts | 0 .../missing-as/input.ts.stderr | 0 .../missing-local/input.ts | 0 .../missing-local/input.ts.stderr | 0 .../redundant-tokens/input.ts | 0 .../redundant-tokens/input.ts.stderr | 0 .../too-many-as/input.ts | 0 .../too-many-as/input.ts.stderr | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/duplicated-type-only/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/duplicated-type-only/input.ts.stderr (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/invalid-local/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/invalid-local/input.ts.stderr (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/invalid-type-only-local-with-imported/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/invalid-type-only-local-with-imported/input.ts.stderr (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/invalid-type-only/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/invalid-type-only/input.ts.stderr (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/missing-as/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/missing-as/input.ts.stderr (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/missing-local/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/missing-local/input.ts.stderr (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/redundant-tokens/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/redundant-tokens/input.ts.stderr (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/too-many-as/input.ts (100%) rename ecmascript/parser/tests/typescript-errors/{type-only-specifier => type-only-import-specifier}/too-many-as/input.ts.stderr (100%) diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-local/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts.stderr diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts.stderr diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts.stderr diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-as/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts.stderr diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/missing-local/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts.stderr diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts.stderr diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts diff --git a/ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts.stderr similarity index 100% rename from ecmascript/parser/tests/typescript-errors/type-only-specifier/too-many-as/input.ts.stderr rename to ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts.stderr From 5c49233a4f8d3f7046ac19922dbe34116240d6d0 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 26 Sep 2021 14:00:43 +0800 Subject: [PATCH 09/17] support type-only export specifiers --- bundler/src/bundler/chunk/computed_key.rs | 1 + bundler/src/bundler/chunk/merge.rs | 5 + ecmascript/ast/src/module_decl.rs | 2 + ecmascript/babel/compat/src/swcify/stmt.rs | 1 + .../parser/src/parser/stmt/module_item.rs | 70 +- .../duplicated-type-only/input.ts | 1 + .../duplicated-type-only/input.ts.stderr | 6 + .../missing-as/input.ts | 1 + .../missing-as/input.ts.stderr | 6 + .../missing-local/input.ts | 1 + .../missing-local/input.ts.stderr | 6 + .../redundant-tokens/input.ts | 1 + .../redundant-tokens/input.ts.stderr | 6 + .../too-many-as/input.ts | 1 + .../too-many-as/input.ts.stderr | 6 + .../duplicated-type-only/input.ts.stderr | 2 +- .../invalid-local/input.ts.stderr | 2 +- .../input.ts.stderr | 2 +- .../invalid-type-only/input.ts.stderr | 2 +- .../missing-as/input.ts.stderr | 2 +- .../missing-local/input.ts.stderr | 2 +- .../redundant-tokens/input.ts.stderr | 2 +- .../too-many-as/input.ts.stderr | 2 +- .../custom/issue-196-02/input.ts.json | 3 +- .../type-only/export/aliased/input.ts.json | 3 +- .../type-only/export/specific/input.ts.json | 3 +- .../export/type-only-specifier/input.ts | 15 + .../export/type-only-specifier/input.ts.json | 596 ++++++++++++++++++ .../export/test1/input.ts.json | 3 +- .../export/test2/input.tsx.json | 3 +- .../es6/modules/exportBinding/input.ts.json | 15 +- .../es6/modules/exportStar-amd/input.ts.json | 9 +- .../tsc/es6/modules/exportStar/input.ts.json | 9 +- .../exportsAndImports1-amd/input.ts.json | 90 ++- .../exportsAndImports1-es6/input.ts.json | 90 ++- .../modules/exportsAndImports1/input.ts.json | 90 ++- .../exportsAndImports2-amd/input.ts.json | 12 +- .../exportsAndImports2-es6/input.ts.json | 12 +- .../modules/exportsAndImports2/input.ts.json | 12 +- .../exportsAndImports3-amd/input.ts.json | 90 ++- .../exportsAndImports3-es6/input.ts.json | 90 ++- .../modules/exportsAndImports3/input.ts.json | 90 ++- .../exportsAndImports4-amd/input.ts.json | 24 +- .../exportsAndImports4-es6/input.ts.json | 24 +- .../modules/exportsAndImports4/input.ts.json | 24 +- .../input.ts.json | 6 +- .../reExportDefaultExport/input.ts.json | 3 +- .../es6modulekindWithES5Target9/input.ts.json | 12 +- .../input.ts.json | 12 +- .../input.ts.json | 3 +- .../exportNonLocalDeclarations/input.ts.json | 6 +- .../importsImplicitlyReadonly/input.ts.json | 3 +- .../typeOnly/chained/input.ts.json | 9 +- .../typeOnly/chained2/input.ts.json | 12 +- .../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 | 3 +- .../typeOnly/exportNamespace3/input.ts.json | 3 +- .../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 +- .../jsDeclarationsClasses/input.ts.json | 12 +- .../jsDeclarationsDefault/input.ts.json | 6 +- .../jsDeclarationsDefaultsErr/input.ts.json | 3 +- .../jsDeclarationsEnums/input.ts.json | 12 +- .../jsDeclarationsExportForms/input.ts.json | 9 +- .../input.ts.json | 6 +- .../jsDeclarationsFunctions/input.ts.json | 12 +- .../input.ts.json | 9 +- .../jsDeclarationsInterfaces/input.ts.json | 12 +- .../input.ts.json | 36 +- .../input.ts.json | 3 +- .../input.ts.json | 3 +- .../input.ts.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 +- ecmascript/transforms/base/src/hygiene/ops.rs | 2 + .../compat/src/es2015/classes/mod.rs | 1 + .../compat/src/es2018/object_rest_spread.rs | 1 + .../compat/src/es2020/class_properties/mod.rs | 1 + .../src/es2020/export_namespace_from.rs | 1 + .../transforms/proposal/src/decorators.rs | 1 + .../proposal/src/decorators/legacy.rs | 1 + .../proposal/src/export_default_from.rs | 1 + ecmascript/transforms/typescript/src/strip.rs | 1 + ecmascript/visit/src/lib.rs | 1 + 97 files changed, 1383 insertions(+), 332 deletions(-) create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts create mode 100644 ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts.stderr create mode 100644 ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts create mode 100644 ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts.json diff --git a/bundler/src/bundler/chunk/computed_key.rs b/bundler/src/bundler/chunk/computed_key.rs index 2612167fbc17..4e86362c34e5 100644 --- a/bundler/src/bundler/chunk/computed_key.rs +++ b/bundler/src/bundler/chunk/computed_key.rs @@ -71,6 +71,7 @@ where span: DUMMY_SP, orig: orig.clone(), exported: Some(exported.clone()), + is_type_only: false, }); addtional_items.push(( module_id, diff --git a/bundler/src/bundler/chunk/merge.rs b/bundler/src/bundler/chunk/merge.rs index 4fb5c101e34a..5cf5595033eb 100644 --- a/bundler/src/bundler/chunk/merge.rs +++ b/bundler/src/bundler/chunk/merge.rs @@ -739,6 +739,7 @@ where span: DUMMY_SP, orig: local, exported: Some(exported), + is_type_only: false, }); extra.push(ModuleItem::ModuleDecl(ModuleDecl::ExportNamed( NamedExport { @@ -785,6 +786,7 @@ where span: DUMMY_SP, orig: local, exported: Some(exported), + is_type_only: false, }); log::trace!("Exporting `default` with `export default expr`"); extra.push(ModuleItem::ModuleDecl(ModuleDecl::ExportNamed( @@ -851,6 +853,7 @@ where span: DUMMY_SP, orig: id, exported: Some(exported), + is_type_only: false, } }) .map(ExportSpecifier::Named) @@ -889,6 +892,7 @@ where span: DUMMY_SP, orig: local, exported: Some(exported), + is_type_only: false, }); extra.push(ModuleItem::ModuleDecl(ModuleDecl::ExportNamed( @@ -1053,6 +1057,7 @@ where span: ns.span, orig: module_var.into(), exported: Some(ns.name.clone()), + is_type_only: false, }); extra.push(ModuleItem::ModuleDecl( ModuleDecl::ExportNamed(NamedExport { diff --git a/ecmascript/ast/src/module_decl.rs b/ecmascript/ast/src/module_decl.rs index 027d8dd52441..67311faccb37 100644 --- a/ecmascript/ast/src/module_decl.rs +++ b/ecmascript/ast/src/module_decl.rs @@ -246,4 +246,6 @@ pub struct ExportNamedSpecifier { /// `Some(bar)` in `export { foo as bar }` #[serde(default)] pub exported: Option, + /// `type` in `export { type foo as bar }` + pub is_type_only: bool, } diff --git a/ecmascript/babel/compat/src/swcify/stmt.rs b/ecmascript/babel/compat/src/swcify/stmt.rs index 060d4129b15b..740748b82455 100644 --- a/ecmascript/babel/compat/src/swcify/stmt.rs +++ b/ecmascript/babel/compat/src/swcify/stmt.rs @@ -568,6 +568,7 @@ impl Swcify for swc_babel_ast::ExportSpecifier { span: ctx.span(&self.base), orig: self.local.swcify(ctx).id, exported: Some(self.exported.swcify(ctx).expect_ident()), + is_type_only: false, // TODO: update this once Babel supports } } } diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index 4fc800e94c31..3d4bdb43fdb2 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -587,7 +587,7 @@ impl<'a, I: Tokens> Parser { } while !eof!(self) && !is!(self, '}') { specifiers.push( - self.parse_named_export_specifier() + self.parse_named_export_specifier(type_only) .map(ExportSpecifier::Named)?, ); @@ -631,10 +631,73 @@ impl<'a, I: Tokens> Parser { })) } - fn parse_named_export_specifier(&mut self) -> PResult { + fn parse_named_export_specifier(&mut self, type_only: bool) -> PResult { let start = cur_pos!(self); - let orig = self.parse_ident_name()?; + let mut is_type_only = false; + let mut orig = self.parse_ident_name()?; + + // Handle: + // `export { type xx }` + // `export { type xx as yy }` + // `export { type as }` + // `export { type as as }` + // `export { type as as as }` + if orig.sym == js_word!("type") + && is!(self, IdentName) + && self.syntax().typescript() + // invalid: `export type { type something }` + && !type_only + { + let possibly_orgi = self.parse_ident_name()?; + if possibly_orgi.sym == js_word!("as") { + // `export { type as }` + if !is!(self, IdentName) { + return Ok(ExportNamedSpecifier { + span: span!(self, start), + orig: possibly_orgi, + exported: None, + is_type_only: true, + }); + } + + let maybe_as = self.parse_ident_name()?; + if maybe_as.sym == js_word!("as") { + if is!(self, IdentName) { + // `export { type as as as }` + // `export { type as as foo }` + let exported = self.parse_ident_name()?; + return Ok(ExportNamedSpecifier { + span: Span::new(start, orig.span.hi(), Default::default()), + orig: possibly_orgi, + exported: Some(exported), + is_type_only: true, + }); + } else { + // `export { type as as }` + return Ok(ExportNamedSpecifier { + span: Span::new(start, orig.span.hi(), Default::default()), + orig, + exported: Some(maybe_as), + is_type_only: false, + }); + } + } else { + // `export { type as xxx }` + return Ok(ExportNamedSpecifier { + span: Span::new(start, orig.span.hi(), Default::default()), + orig, + exported: Some(maybe_as), + is_type_only: false, + }); + } + } else { + // `export { type xx }` + // `export { type xx as yy }` + orig = possibly_orgi; + is_type_only = true; + } + } let exported = if eat!(self, "as") { Some(self.parse_ident_name()?) @@ -646,6 +709,7 @@ impl<'a, I: Tokens> Parser { span: span!(self, start), orig, exported, + is_type_only, }) } diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts new file mode 100644 index 000000000000..8b9e5291d5ce --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts @@ -0,0 +1 @@ +export type { type something } diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr new file mode 100644 index 000000000000..7fa2e39facfb --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ',', got 'something' + --> $DIR/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts:1:20 + | +1 | export type { type something } + | ^^^^^^^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts new file mode 100644 index 000000000000..ae1349af057a --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts @@ -0,0 +1 @@ +export { type foo bar } diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts.stderr new file mode 100644 index 000000000000..6c4ea73159fe --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ',', got 'bar' + --> $DIR/tests/typescript-errors/type-only-export-specifier/missing-as/input.ts:1:19 + | +1 | export { type foo bar } + | ^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts new file mode 100644 index 000000000000..67be6185fe35 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts @@ -0,0 +1 @@ +export { type foo as } diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts.stderr new file mode 100644 index 000000000000..a3b8fd1b4fe6 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ident + --> $DIR/tests/typescript-errors/type-only-export-specifier/missing-local/input.ts:1:22 + | +1 | export { type foo as } + | ^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts new file mode 100644 index 000000000000..10f6d0dbdcdd --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts @@ -0,0 +1 @@ +export { type foo as bar baz } diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts.stderr new file mode 100644 index 000000000000..529a6f834376 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ',', got 'baz' + --> $DIR/tests/typescript-errors/type-only-export-specifier/redundant-tokens/input.ts:1:26 + | +1 | export { type foo as bar baz } + | ^^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts new file mode 100644 index 000000000000..1c1ee4c524f8 --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts @@ -0,0 +1 @@ +export { type as as as as } diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts.stderr new file mode 100644 index 000000000000..cb106c499a1f --- /dev/null +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts.stderr @@ -0,0 +1,6 @@ +error: Expected ',', got 'as' + --> $DIR/tests/typescript-errors/type-only-export-specifier/too-many-as/input.ts:1:24 + | +1 | export { type as as as as } + | ^^ + diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr index 8596f0431af0..7d04b837b151 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr @@ -1,5 +1,5 @@ error: Expected ',', got 'something' - --> $DIR/tests/typescript-errors/type-only-specifier/duplicated-type-only/input.ts:1:20 + --> $DIR/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts:1:20 | 1 | import type { type something } from 'mod' | ^^^^^^^^^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts.stderr index 10b7142f8911..46cde004d86d 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts.stderr @@ -1,5 +1,5 @@ error: Expected ident - --> $DIR/tests/typescript-errors/type-only-specifier/invalid-local/input.ts:1:18 + --> $DIR/tests/typescript-errors/type-only-import-specifier/invalid-local/input.ts:1:18 | 1 | import { type as export } from 'mod' | ^^^^^^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts.stderr index 75cef3a1e687..09658f0dea8c 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts.stderr @@ -1,5 +1,5 @@ error: Expected ident - --> $DIR/tests/typescript-errors/type-only-specifier/invalid-type-only-local-with-imported/input.ts:1:21 + --> $DIR/tests/typescript-errors/type-only-import-specifier/invalid-type-only-local-with-imported/input.ts:1:21 | 1 | import { type as as export } from 'mod' | ^^^^^^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts.stderr index b4c81a106b24..9eeadc830258 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts.stderr @@ -1,5 +1,5 @@ error: cannot import as reserved word - --> $DIR/tests/typescript-errors/type-only-specifier/invalid-type-only/input.ts:1:15 + --> $DIR/tests/typescript-errors/type-only-import-specifier/invalid-type-only/input.ts:1:15 | 1 | import { type import } from 'mod' | ^^^^^^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts.stderr index 6c3e5584dcfe..7dd4393375cc 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts.stderr @@ -1,5 +1,5 @@ error: Expected ',', got 'bar' - --> $DIR/tests/typescript-errors/type-only-specifier/missing-as/input.ts:1:19 + --> $DIR/tests/typescript-errors/type-only-import-specifier/missing-as/input.ts:1:19 | 1 | import { type foo bar } from 'mod' | ^^^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts.stderr index d3a75131552d..21558f8c41fa 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts.stderr @@ -1,5 +1,5 @@ error: Expected ident - --> $DIR/tests/typescript-errors/type-only-specifier/missing-local/input.ts:1:22 + --> $DIR/tests/typescript-errors/type-only-import-specifier/missing-local/input.ts:1:22 | 1 | import { type foo as } from 'mod' | ^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts.stderr index 5549a5715e27..d1a7c93c72d7 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts.stderr @@ -1,5 +1,5 @@ error: Expected ',', got 'baz' - --> $DIR/tests/typescript-errors/type-only-specifier/redundant-tokens/input.ts:1:26 + --> $DIR/tests/typescript-errors/type-only-import-specifier/redundant-tokens/input.ts:1:26 | 1 | import { type foo as bar baz } from 'mod' | ^^^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts.stderr index 1b81cb1e3780..b61b035f77ff 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts.stderr @@ -1,5 +1,5 @@ error: Expected ',', got 'as' - --> $DIR/tests/typescript-errors/type-only-specifier/too-many-as/input.ts:1:24 + --> $DIR/tests/typescript-errors/type-only-import-specifier/too-many-as/input.ts:1:24 | 1 | import { type as as as as } from 'mod' | ^^ 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 78e5a05e473c..b9984bd525d1 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 @@ -143,7 +143,8 @@ "value": "Link", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 3d4b410d2c07..ebe75a3f8c94 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 @@ -40,7 +40,8 @@ }, "value": "Bar", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 b4e2ef6eac0b..a2b3637caef0 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 @@ -31,7 +31,8 @@ "value": "Foo", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, diff --git a/ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts b/ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts new file mode 100644 index 000000000000..0a34ee9124b1 --- /dev/null +++ b/ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts @@ -0,0 +1,15 @@ +export { type } +export type { type } +export { type foo } +export { type as } +export { type foo as bar } +export { type foo as as } +export { type as as } +export { type as foo } +export { type as type } +export { type as as foo } +export { type as as as } +export { type type as as } +export { type export } +export { type as export } +export { type as as export } diff --git a/ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts.json b/ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts.json new file mode 100644 index 000000000000..14a520105e61 --- /dev/null +++ b/ecmascript/parser/tests/typescript/custom/type-only/export/type-only-specifier/input.ts.json @@ -0,0 +1,596 @@ +{ + "type": "Module", + "span": { + "start": 0, + "end": 353, + "ctxt": 0 + }, + "body": [ + { + "type": "ExportNamedDeclaration", + "span": { + "start": 0, + "end": 15, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 9, + "end": 13, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 9, + "end": 13, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 16, + "end": 36, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 30, + "end": 34, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 30, + "end": 34, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "exported": null, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": true, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 37, + "end": 56, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 46, + "end": 54, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 51, + "end": 54, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "exported": null, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 57, + "end": 75, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 66, + "end": 73, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 71, + "end": 73, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "exported": null, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 76, + "end": 102, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 85, + "end": 100, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 90, + "end": 93, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 97, + "end": 100, + "ctxt": 0 + }, + "value": "bar", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 103, + "end": 128, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 112, + "end": 126, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 117, + "end": 120, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 124, + "end": 126, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 129, + "end": 150, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 138, + "end": 142, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 138, + "end": 142, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 146, + "end": 148, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 151, + "end": 173, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 160, + "end": 164, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 160, + "end": 164, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 168, + "end": 171, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 174, + "end": 197, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 183, + "end": 187, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 183, + "end": 187, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 191, + "end": 195, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 198, + "end": 223, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 207, + "end": 211, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 212, + "end": 214, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 218, + "end": 221, + "ctxt": 0 + }, + "value": "foo", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 224, + "end": 248, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 233, + "end": 237, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 238, + "end": 240, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 244, + "end": 246, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 249, + "end": 275, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 258, + "end": 273, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 263, + "end": 267, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 271, + "end": 273, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 276, + "end": 298, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 285, + "end": 296, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 290, + "end": 296, + "ctxt": 0 + }, + "value": "export", + "optional": false + }, + "exported": null, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 299, + "end": 324, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 308, + "end": 312, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 308, + "end": 312, + "ctxt": 0 + }, + "value": "type", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 316, + "end": 322, + "ctxt": 0 + }, + "value": "export", + "optional": false + }, + "isTypeOnly": false + } + ], + "source": null, + "typeOnly": false, + "asserts": null + }, + { + "type": "ExportNamedDeclaration", + "span": { + "start": 325, + "end": 353, + "ctxt": 0 + }, + "specifiers": [ + { + "type": "ExportSpecifier", + "span": { + "start": 334, + "end": 338, + "ctxt": 0 + }, + "orig": { + "type": "Identifier", + "span": { + "start": 339, + "end": 341, + "ctxt": 0 + }, + "value": "as", + "optional": false + }, + "exported": { + "type": "Identifier", + "span": { + "start": 345, + "end": 351, + "ctxt": 0 + }, + "value": "export", + "optional": false + }, + "isTypeOnly": true + } + ], + "source": null, + "typeOnly": false, + "asserts": null + } + ], + "interpreter": null +} 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 index 1c2a750bfd76..d589f4c5814e 100644 --- a/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts.json +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test1/input.ts.json @@ -31,7 +31,8 @@ "value": "val", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 index 3e277bc2cbda..628bc03e3bd1 100644 --- a/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx.json +++ b/ecmascript/parser/tests/typescript/import-assertions/export/test2/input.tsx.json @@ -31,7 +31,8 @@ "value": "val", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 054cdc0c8de3..705c5d4e35a6 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 @@ -31,7 +31,8 @@ "value": "x", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -72,7 +73,8 @@ }, "value": "xx", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -177,7 +179,8 @@ }, "value": "Z", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -235,7 +238,8 @@ "value": "y", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -276,7 +280,8 @@ }, "value": "yy", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 cc12e0af3993..987ba50a01cd 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 @@ -331,7 +331,8 @@ "value": "x", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -350,7 +351,8 @@ "value": "y", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -369,7 +371,8 @@ "value": "z", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 68db9a6f5675..ffc57d3a9fd5 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 @@ -331,7 +331,8 @@ "value": "x", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -350,7 +351,8 @@ "value": "y", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -369,7 +371,8 @@ "value": "z", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 af89e76a22d4..6ac398cefe26 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 @@ -532,7 +532,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -551,7 +552,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -570,7 +572,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -589,7 +592,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -608,7 +612,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -627,7 +632,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -646,7 +652,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -665,7 +672,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -684,7 +692,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -703,7 +712,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -735,7 +745,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -754,7 +765,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -773,7 +785,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -792,7 +805,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -811,7 +825,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -830,7 +845,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -849,7 +865,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -868,7 +885,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -887,7 +905,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -906,7 +925,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -1177,7 +1197,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1196,7 +1217,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1215,7 +1237,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1234,7 +1257,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1253,7 +1277,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1272,7 +1297,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1291,7 +1317,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1310,7 +1337,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1329,7 +1357,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1348,7 +1377,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 b9613df62afa..bd9ee6365884 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 @@ -532,7 +532,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -551,7 +552,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -570,7 +572,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -589,7 +592,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -608,7 +612,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -627,7 +632,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -646,7 +652,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -665,7 +672,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -684,7 +692,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -703,7 +712,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -735,7 +745,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -754,7 +765,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -773,7 +785,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -792,7 +805,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -811,7 +825,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -830,7 +845,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -849,7 +865,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -868,7 +885,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -887,7 +905,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -906,7 +925,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -1177,7 +1197,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1196,7 +1217,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1215,7 +1237,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1234,7 +1257,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1253,7 +1277,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1272,7 +1297,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1291,7 +1317,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1310,7 +1337,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1329,7 +1357,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1348,7 +1377,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 55352ae21f89..42ead5ab290d 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 @@ -532,7 +532,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -551,7 +552,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -570,7 +572,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -589,7 +592,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -608,7 +612,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -627,7 +632,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -646,7 +652,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -665,7 +672,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -684,7 +692,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -703,7 +712,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -735,7 +745,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -754,7 +765,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -773,7 +785,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -792,7 +805,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -811,7 +825,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -830,7 +845,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -849,7 +865,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -868,7 +885,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -887,7 +905,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -906,7 +925,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -1177,7 +1197,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1196,7 +1217,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1215,7 +1237,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1234,7 +1257,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1253,7 +1277,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1272,7 +1297,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1291,7 +1317,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1310,7 +1337,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1329,7 +1357,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1348,7 +1377,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 cebedbf4fb99..a7bd73081f85 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 @@ -148,7 +148,8 @@ }, "value": "y", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -176,7 +177,8 @@ }, "value": "x", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -296,7 +298,8 @@ }, "value": "y", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -324,7 +327,8 @@ }, "value": "x", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 212e88a70be9..f59dac008bba 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 @@ -148,7 +148,8 @@ }, "value": "y", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -176,7 +177,8 @@ }, "value": "x", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -296,7 +298,8 @@ }, "value": "y", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -324,7 +327,8 @@ }, "value": "x", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 c460ff7acf8d..dab3c691bfdb 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 @@ -148,7 +148,8 @@ }, "value": "y", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -176,7 +177,8 @@ }, "value": "x", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -296,7 +298,8 @@ }, "value": "y", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -324,7 +327,8 @@ }, "value": "x", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 61430ff79628..dd5093a1cadc 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 @@ -613,7 +613,8 @@ }, "value": "v1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -641,7 +642,8 @@ }, "value": "f1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -669,7 +671,8 @@ }, "value": "C1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -697,7 +700,8 @@ }, "value": "I1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -725,7 +729,8 @@ }, "value": "E1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -753,7 +758,8 @@ }, "value": "D1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -781,7 +787,8 @@ }, "value": "M1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -809,7 +816,8 @@ }, "value": "N1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -837,7 +845,8 @@ }, "value": "T1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -865,7 +874,8 @@ }, "value": "a1", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -906,7 +916,8 @@ }, "value": "v", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -934,7 +945,8 @@ }, "value": "f", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -962,7 +974,8 @@ }, "value": "C", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -990,7 +1003,8 @@ }, "value": "I", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1018,7 +1032,8 @@ }, "value": "E", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1046,7 +1061,8 @@ }, "value": "D", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1074,7 +1090,8 @@ }, "value": "M", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1102,7 +1119,8 @@ }, "value": "N", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1130,7 +1148,8 @@ }, "value": "T", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1158,7 +1177,8 @@ }, "value": "a", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -1519,7 +1539,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1538,7 +1559,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1557,7 +1579,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1576,7 +1599,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1595,7 +1619,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1614,7 +1639,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1633,7 +1659,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1652,7 +1679,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1671,7 +1699,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1690,7 +1719,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 44d6e9288345..120b659e6329 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 @@ -613,7 +613,8 @@ }, "value": "v1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -641,7 +642,8 @@ }, "value": "f1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -669,7 +671,8 @@ }, "value": "C1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -697,7 +700,8 @@ }, "value": "I1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -725,7 +729,8 @@ }, "value": "E1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -753,7 +758,8 @@ }, "value": "D1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -781,7 +787,8 @@ }, "value": "M1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -809,7 +816,8 @@ }, "value": "N1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -837,7 +845,8 @@ }, "value": "T1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -865,7 +874,8 @@ }, "value": "a1", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -906,7 +916,8 @@ }, "value": "v", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -934,7 +945,8 @@ }, "value": "f", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -962,7 +974,8 @@ }, "value": "C", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -990,7 +1003,8 @@ }, "value": "I", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1018,7 +1032,8 @@ }, "value": "E", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1046,7 +1061,8 @@ }, "value": "D", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1074,7 +1090,8 @@ }, "value": "M", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1102,7 +1119,8 @@ }, "value": "N", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1130,7 +1148,8 @@ }, "value": "T", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1158,7 +1177,8 @@ }, "value": "a", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -1519,7 +1539,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1538,7 +1559,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1557,7 +1579,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1576,7 +1599,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1595,7 +1619,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1614,7 +1639,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1633,7 +1659,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1652,7 +1679,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1671,7 +1699,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1690,7 +1719,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 f06a3615e947..bba0c97296d4 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 @@ -613,7 +613,8 @@ }, "value": "v1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -641,7 +642,8 @@ }, "value": "f1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -669,7 +671,8 @@ }, "value": "C1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -697,7 +700,8 @@ }, "value": "I1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -725,7 +729,8 @@ }, "value": "E1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -753,7 +758,8 @@ }, "value": "D1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -781,7 +787,8 @@ }, "value": "M1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -809,7 +816,8 @@ }, "value": "N1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -837,7 +845,8 @@ }, "value": "T1", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -865,7 +874,8 @@ }, "value": "a1", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -906,7 +916,8 @@ }, "value": "v", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -934,7 +945,8 @@ }, "value": "f", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -962,7 +974,8 @@ }, "value": "C", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -990,7 +1003,8 @@ }, "value": "I", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1018,7 +1032,8 @@ }, "value": "E", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1046,7 +1061,8 @@ }, "value": "D", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1074,7 +1090,8 @@ }, "value": "M", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1102,7 +1119,8 @@ }, "value": "N", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1130,7 +1148,8 @@ }, "value": "T", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1158,7 +1177,8 @@ }, "value": "a", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -1519,7 +1539,8 @@ "value": "v", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1538,7 +1559,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1557,7 +1579,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1576,7 +1599,8 @@ "value": "I", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1595,7 +1619,8 @@ "value": "E", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1614,7 +1639,8 @@ "value": "D", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1633,7 +1659,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1652,7 +1679,8 @@ "value": "N", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1671,7 +1699,8 @@ "value": "T", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1690,7 +1719,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 3cd545f2d285..57ec5d3c2c4a 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 @@ -1122,7 +1122,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1141,7 +1142,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1160,7 +1162,8 @@ "value": "c", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1179,7 +1182,8 @@ "value": "d", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1198,7 +1202,8 @@ "value": "e1", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1217,7 +1222,8 @@ "value": "e2", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1236,7 +1242,8 @@ "value": "f1", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1255,7 +1262,8 @@ "value": "f2", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 5ffabf918896..5ba3f9f6286d 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 @@ -1122,7 +1122,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1141,7 +1142,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1160,7 +1162,8 @@ "value": "c", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1179,7 +1182,8 @@ "value": "d", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1198,7 +1202,8 @@ "value": "e1", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1217,7 +1222,8 @@ "value": "e2", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1236,7 +1242,8 @@ "value": "f1", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1255,7 +1262,8 @@ "value": "f2", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 5ffabf918896..5ba3f9f6286d 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 @@ -1122,7 +1122,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1141,7 +1142,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1160,7 +1162,8 @@ "value": "c", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1179,7 +1182,8 @@ "value": "d", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1198,7 +1202,8 @@ "value": "e1", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1217,7 +1222,8 @@ "value": "e2", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1236,7 +1242,8 @@ "value": "f1", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -1255,7 +1262,8 @@ "value": "f2", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 490e1867d878..3cc2d6170266 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 @@ -81,7 +81,8 @@ }, "value": "return", "optional": false - } + }, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -100,7 +101,8 @@ "value": "as", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 856453e34594..bedd43d991a5 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 @@ -72,7 +72,8 @@ "value": "f", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 ca844590c0f0..9c7f79623cf1 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 @@ -165,7 +165,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -197,7 +198,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -229,7 +231,8 @@ "value": "d", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -284,7 +287,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 ca844590c0f0..9c7f79623cf1 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 @@ -165,7 +165,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -197,7 +198,8 @@ "value": "M", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -229,7 +231,8 @@ "value": "d", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -284,7 +287,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 5d4c1ed92282..791e919acb45 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/exportAssignmentOfExportNamespaceWithDefault/input.ts.json @@ -285,7 +285,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 78f3d342222d..c28b1cc16846 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/exportNonLocalDeclarations/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/exportNonLocalDeclarations/input.ts.json @@ -31,7 +31,8 @@ "value": "string", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -63,7 +64,8 @@ "value": "number", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 2815994926ad..a8bed6d26fae 100644 --- a/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/externalModules/importsImplicitlyReadonly/input.ts.json @@ -121,7 +121,8 @@ "value": "y", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 11fc30451bbc..24afbac7ab85 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 @@ -113,7 +113,8 @@ }, "value": "B", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -256,7 +257,8 @@ }, "value": "C", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -356,7 +358,8 @@ }, "value": "D", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 b0cb76b77b31..f08bb422e5c1 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 @@ -113,7 +113,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -244,7 +245,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -263,7 +265,8 @@ "value": "B", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -348,7 +351,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 c98b55c3e80d..b8c9bfadb767 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 @@ -31,7 +31,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -76,7 +77,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 92ab527873b9..5a6e451092a3 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 @@ -86,7 +86,8 @@ }, "value": "B", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -173,7 +174,8 @@ }, "value": "A", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 f72ac6dba357..6114970163c0 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 @@ -57,7 +57,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 6dee1d102e73..de5a2e59d2ff 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 @@ -68,7 +68,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 e2d0779cd481..4c5d151b883f 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 @@ -65,7 +65,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 3f296cf71866..060a3be5dfae 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 @@ -72,7 +72,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -153,7 +154,8 @@ "value": "AA", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 9f3bdd0e527f..b4e10dd22770 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 @@ -65,7 +65,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 29ed8f2d96e2..c138a8829736 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 @@ -65,7 +65,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { 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 f4400792aa6d..8b08c16a7f4f 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 @@ -160,7 +160,8 @@ }, "value": "B", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 ca7918ce1b3d..96be7f872d6b 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 @@ -113,7 +113,8 @@ "value": "types", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 866ddc3d559b..68005edcab21 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 @@ -57,7 +57,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 a29a52593060..bf7ed1675e21 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 @@ -57,7 +57,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 ab85e02e694f..828efbffc995 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 @@ -104,7 +104,8 @@ "value": "A", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 6a287a564f1b..8ef6f0a3bf75 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 @@ -113,7 +113,8 @@ }, "value": "B", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -154,7 +155,8 @@ }, "value": "C", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 513df9063de5..d6b8baaa6221 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 @@ -1484,7 +1484,8 @@ "value": "G", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -1551,7 +1552,8 @@ }, "value": "H", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -1626,7 +1628,8 @@ }, "value": "II", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -1667,7 +1670,8 @@ }, "value": "JJ", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 92d680baabb0..8a3cbe73627e 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 @@ -167,7 +167,8 @@ }, "value": "bar", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -345,7 +346,8 @@ }, "value": "Bar", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 fd507bdffc4c..46934b0991d7 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 @@ -248,7 +248,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 fe174a9a8d73..df474b4d584d 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 @@ -130,7 +130,8 @@ "value": "C", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -192,7 +193,8 @@ }, "value": "D", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -262,7 +264,8 @@ }, "value": "EE", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -303,7 +306,8 @@ }, "value": "FF", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 e34b1362d35d..4377471d8bdf 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 @@ -222,7 +222,8 @@ "value": "Foo", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -360,7 +361,8 @@ "value": "ns", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -445,7 +447,8 @@ }, "value": "classContainer", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 c96e07ee20c9..08dd792e4144 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 @@ -99,7 +99,8 @@ "value": "Thing", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -127,7 +128,8 @@ }, "value": "default", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 d58ac32b03d1..ffaa26455870 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 @@ -794,7 +794,8 @@ "value": "g", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -996,7 +997,8 @@ }, "value": "h", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -1079,7 +1081,8 @@ }, "value": "ii", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -1120,7 +1123,8 @@ }, "value": "jj", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 a0001224dc0a..bf297bd5f5d5 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 @@ -72,7 +72,8 @@ "value": "myTypes", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -369,7 +370,8 @@ "value": "testFn", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -388,7 +390,8 @@ "value": "testFnTypes", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 0ac30f8a7a8d..826b7f9e0a77 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 @@ -1439,7 +1439,8 @@ "value": "G", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -1510,7 +1511,8 @@ }, "value": "H", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -1589,7 +1591,8 @@ }, "value": "II", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, @@ -1630,7 +1633,8 @@ }, "value": "JJ", "optional": false - } + }, + "isTypeOnly": false } ], "source": null, 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 5e7e146f6873..132335ebd9f9 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 @@ -178,7 +178,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -197,7 +198,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -216,7 +218,8 @@ "value": "c", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -261,7 +264,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -306,7 +310,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -325,7 +330,8 @@ "value": "c", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -370,7 +376,8 @@ "value": "a", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false }, { "type": "ExportSpecifier", @@ -389,7 +396,8 @@ "value": "b", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -443,7 +451,8 @@ }, "value": "aa", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -497,7 +506,8 @@ }, "value": "bb", "optional": false - } + }, + "isTypeOnly": false } ], "source": { @@ -542,7 +552,8 @@ "value": "c", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": { @@ -596,7 +607,8 @@ }, "value": "cc", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 aa7a61e89ff6..7e013422f116 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 @@ -188,7 +188,8 @@ }, "value": "Foob", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 b35414a150ff..f37d70764c90 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 @@ -237,7 +237,8 @@ }, "value": "Foob", "optional": false - } + }, + "isTypeOnly": false } ], "source": { 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 062b7ab87591..eeb772f41f0a 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 @@ -357,7 +357,8 @@ "value": "thing", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 d19b3aea6ff4..341d85c89abe 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 @@ -237,7 +237,8 @@ }, "value": "p", "optional": false - } + }, + "isTypeOnly": false } ], "source": 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 693ce3cfd023..e0f05be2be03 100644 --- a/ecmascript/parser/tests/typescript/tsc/salsa/requireOfESWithPropertyAccess/input.ts.json +++ b/ecmascript/parser/tests/typescript/tsc/salsa/requireOfESWithPropertyAccess/input.ts.json @@ -295,7 +295,8 @@ "value": "x", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 2ab8eb64f0a7..467bb616abcf 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 @@ -223,7 +223,8 @@ "value": "c", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, @@ -389,7 +390,8 @@ "value": "d", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": 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 6b15581730bc..b42a715f920a 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 @@ -983,7 +983,8 @@ "value": "Bar", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 33bef78e99ee..9c11c0bafd4a 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 @@ -658,7 +658,8 @@ "value": "Bar", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, 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 c9f3ac3358eb..e8a90801f07e 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 @@ -658,7 +658,8 @@ "value": "Bar", "optional": false }, - "exported": null + "exported": null, + "isTypeOnly": false } ], "source": null, diff --git a/ecmascript/transforms/base/src/hygiene/ops.rs b/ecmascript/transforms/base/src/hygiene/ops.rs index bc7b5e3be131..e6d2f7c8cdad 100644 --- a/ecmascript/transforms/base/src/hygiene/ops.rs +++ b/ecmascript/transforms/base/src/hygiene/ops.rs @@ -32,6 +32,7 @@ impl<'a> VisitMut for Operator<'a> { span: DUMMY_SP, orig: $ident, exported: Some($orig), + is_type_only: false, })], src: None, type_only: false, @@ -300,6 +301,7 @@ impl VisitMut for VarFolder<'_, '_> { span: i.span, exported: Some(orig), orig: i.clone(), + is_type_only: false, })); } Err(..) => {} diff --git a/ecmascript/transforms/compat/src/es2015/classes/mod.rs b/ecmascript/transforms/compat/src/es2015/classes/mod.rs index cf7802af6106..49ad9644898b 100644 --- a/ecmascript/transforms/compat/src/es2015/classes/mod.rs +++ b/ecmascript/transforms/compat/src/es2015/classes/mod.rs @@ -115,6 +115,7 @@ where span: DUMMY_SP, orig: ident, exported: Some(quote_ident!("default")), + is_type_only: false, } .into()], src: None, diff --git a/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs b/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs index 4b2867366966..c4f9c3ba2ec7 100644 --- a/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs +++ b/ecmascript/transforms/compat/src/es2018/object_rest_spread.rs @@ -232,6 +232,7 @@ impl Fold for RestFolder { span: DUMMY_SP, orig: Ident::new(sym, DUMMY_SP.with_ctxt(ctxt)), exported: None, + is_type_only: false, }) .map(ExportSpecifier::Named) .collect() diff --git a/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs b/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs index 8efbcc75b10d..5b8591624ac4 100644 --- a/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs +++ b/ecmascript/transforms/compat/src/es2020/class_properties/mod.rs @@ -222,6 +222,7 @@ impl ClassProperties { span: DUMMY_SP, orig: ident, exported: Some(private_ident!("default")), + is_type_only: false, } .into()], src: None, diff --git a/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs b/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs index f35c4ec7c9c2..23b6771692dd 100644 --- a/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs +++ b/ecmascript/transforms/compat/src/es2020/export_namespace_from.rs @@ -58,6 +58,7 @@ impl Fold for ExportNamespaceFrom { span: DUMMY_SP, orig: local, exported: Some(ns.name), + is_type_only: false, }, )], src: None, diff --git a/ecmascript/transforms/proposal/src/decorators.rs b/ecmascript/transforms/proposal/src/decorators.rs index ee7cb8403e2e..9f63561cf1b2 100644 --- a/ecmascript/transforms/proposal/src/decorators.rs +++ b/ecmascript/transforms/proposal/src/decorators.rs @@ -201,6 +201,7 @@ impl Fold for Decorators { span: DUMMY_SP, orig: ident, exported: Some(quote_ident!("default")), + is_type_only: false, } .into()], src: None, diff --git a/ecmascript/transforms/proposal/src/decorators/legacy.rs b/ecmascript/transforms/proposal/src/decorators/legacy.rs index 35eee368eb4c..35f28096ebe5 100644 --- a/ecmascript/transforms/proposal/src/decorators/legacy.rs +++ b/ecmascript/transforms/proposal/src/decorators/legacy.rs @@ -182,6 +182,7 @@ impl Fold for Legacy { span: DUMMY_SP, orig: export_ident.clone(), exported: Some(quote_ident!("default")), + is_type_only: false, })); return ModuleItem::Stmt(Stmt::Decl(Decl::Var(VarDecl { diff --git a/ecmascript/transforms/proposal/src/export_default_from.rs b/ecmascript/transforms/proposal/src/export_default_from.rs index 38d1de9b8102..30245a4af1ea 100644 --- a/ecmascript/transforms/proposal/src/export_default_from.rs +++ b/ecmascript/transforms/proposal/src/export_default_from.rs @@ -58,6 +58,7 @@ impl Fold for ExportDefaultFrom { span: DUMMY_SP, orig: local, exported: Some(default), + is_type_only: false, }, )], src: None, diff --git a/ecmascript/transforms/typescript/src/strip.rs b/ecmascript/transforms/typescript/src/strip.rs index e0dc2d6a0ebb..2c4da61c65d4 100644 --- a/ecmascript/transforms/typescript/src/strip.rs +++ b/ecmascript/transforms/typescript/src/strip.rs @@ -459,6 +459,7 @@ impl Strip { js_word!("default"), DUMMY_SP, )), + is_type_only: false, } .into()], src: None, diff --git a/ecmascript/visit/src/lib.rs b/ecmascript/visit/src/lib.rs index 1fccb0a33634..e5a6a8ec53f3 100644 --- a/ecmascript/visit/src/lib.rs +++ b/ecmascript/visit/src/lib.rs @@ -1054,6 +1054,7 @@ define!({ pub span: Span, pub orig: Ident, pub exported: Option, + pub is_type_only: bool, } pub enum BinaryOp { EqEq, From 151390515c433f786bc7c6d17dd8a35f383d6688 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 26 Sep 2021 14:15:35 +0800 Subject: [PATCH 10/17] don't emit type-only export specifiers --- ecmascript/codegen/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs index 9f7d5bd521d8..5649547378f1 100644 --- a/ecmascript/codegen/src/lib.rs +++ b/ecmascript/codegen/src/lib.rs @@ -319,6 +319,11 @@ impl<'a> Emitter<'a> { } result } + ExportSpecifier::Named(ExportNamedSpecifier { is_type_only, .. }) + if *is_type_only => + { + result + } spec => { result.has_named_specs = true; result.named_specs.push(spec); From dd18d9519cf4b700e6f8fe104cfc9ab4c94d9c75 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Sun, 26 Sep 2021 16:26:29 +0800 Subject: [PATCH 11/17] ignore type-only specifiers in transformer --- ecmascript/transforms/module/src/amd.rs | 7 +++++-- ecmascript/transforms/module/src/common_js.rs | 7 +++++-- ecmascript/transforms/module/src/import_analysis.rs | 4 +++- ecmascript/transforms/module/src/umd.rs | 7 +++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ecmascript/transforms/module/src/amd.rs b/ecmascript/transforms/module/src/amd.rs index 2a023faa72bf..5ce28ef5ced9 100644 --- a/ecmascript/transforms/module/src/amd.rs +++ b/ecmascript/transforms/module/src/amd.rs @@ -338,8 +338,10 @@ where stmts.reserve(export.specifiers.len()); - for ExportNamedSpecifier { orig, exported, .. } in - export.specifiers.into_iter().map(|e| match e { + for ExportNamedSpecifier { orig, exported, .. } in export + .specifiers + .into_iter() + .map(|e| match e { ExportSpecifier::Named(e) => e, ExportSpecifier::Default(..) => unreachable!( "export default from 'foo'; should be removed by previous \ @@ -350,6 +352,7 @@ where previous pass" ), }) + .filter(|e| !e.is_type_only) { let mut scope_ref_mut = self.scope.borrow_mut(); let scope = &mut *scope_ref_mut; diff --git a/ecmascript/transforms/module/src/common_js.rs b/ecmascript/transforms/module/src/common_js.rs index c3aaa2795b16..06dab8472aac 100644 --- a/ecmascript/transforms/module/src/common_js.rs +++ b/ecmascript/transforms/module/src/common_js.rs @@ -361,14 +361,17 @@ where drop(scope); - for ExportNamedSpecifier { orig, exported, .. } in - export.specifiers.into_iter().map(|e| match e { + for ExportNamedSpecifier { orig, exported, .. } in export + .specifiers + .into_iter() + .map(|e| match e { ExportSpecifier::Named(e) => e, _ => unreachable!( "export default from 'foo'; should be removed by previous \ pass" ), }) + .filter(|e| !e.is_type_only) { let mut scope = self.scope.borrow_mut(); let is_import_default = orig.sym == js_word!("default"); diff --git a/ecmascript/transforms/module/src/import_analysis.rs b/ecmascript/transforms/module/src/import_analysis.rs index 819300c80593..b796c3a943af 100644 --- a/ecmascript/transforms/module/src/import_analysis.rs +++ b/ecmascript/transforms/module/src/import_analysis.rs @@ -109,6 +109,8 @@ impl Visit for ImportAnalyzer { .entry(import.src.value.clone()) .or_insert(false); } + ImportSpecifier::Named(ImportNamedSpecifier { is_type_only, .. }) + if is_type_only => {} ImportSpecifier::Named(ref i) => { let ImportNamedSpecifier { ref local, @@ -155,7 +157,7 @@ impl Visit for ImportAnalyzer { let mut scope = self.scope.borrow_mut(); for &ExportNamedSpecifier { ref orig, .. } in export.specifiers.iter().filter_map(|e| match *e { - ExportSpecifier::Named(ref e) => Some(e), + ExportSpecifier::Named(ref e) if !e.is_type_only => Some(e), _ => None, }) { diff --git a/ecmascript/transforms/module/src/umd.rs b/ecmascript/transforms/module/src/umd.rs index 741ea766a862..5acc78f6aaa2 100644 --- a/ecmascript/transforms/module/src/umd.rs +++ b/ecmascript/transforms/module/src/umd.rs @@ -343,8 +343,10 @@ where stmts.reserve(export.specifiers.len()); - for ExportNamedSpecifier { orig, exported, .. } in - export.specifiers.into_iter().map(|e| match e { + for ExportNamedSpecifier { orig, exported, .. } in export + .specifiers + .into_iter() + .map(|e| match e { ExportSpecifier::Named(e) => e, ExportSpecifier::Default(..) => unreachable!( "export default from 'foo'; should be removed by previous \ @@ -355,6 +357,7 @@ where previous pass" ), }) + .filter(|e| !e.is_type_only) { let is_import_default = orig.sym == js_word!("default"); From 6389d7cdc2f2d53aefc0639866f5beb59ccdcb85 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Tue, 28 Sep 2021 18:01:57 +0800 Subject: [PATCH 12/17] fix AST node attributes --- ecmascript/ast/src/module_decl.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ecmascript/ast/src/module_decl.rs b/ecmascript/ast/src/module_decl.rs index 67311faccb37..b699e0c6338c 100644 --- a/ecmascript/ast/src/module_decl.rs +++ b/ecmascript/ast/src/module_decl.rs @@ -200,6 +200,7 @@ pub struct ImportNamedSpecifier { #[serde(default)] pub imported: Option, + #[serde(default)] pub is_type_only: bool, } @@ -247,5 +248,6 @@ pub struct ExportNamedSpecifier { #[serde(default)] pub exported: Option, /// `type` in `export { type foo as bar }` + #[serde(default)] pub is_type_only: bool, } From 73338fed1673261298cd1b49bd69026dd11d4760 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Tue, 28 Sep 2021 18:03:22 +0800 Subject: [PATCH 13/17] fix typo --- .../parser/src/parser/stmt/module_item.rs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index 3d4bdb43fdb2..ab941fb014fd 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -196,21 +196,21 @@ impl<'a, I: Tokens> Parser { // invalid: `import type { type something } from 'mod'` && !is_type_only_import { - let possibly_orgi_name = self.parse_ident_name()?; - if possibly_orgi_name.sym == js_word!("as") { + let possibly_orig_name = self.parse_ident_name()?; + if possibly_orig_name.sym == js_word!("as") { // `import { type as } from 'mod'` if !is!(self, IdentName) { - if self.ctx().is_reserved_word(&possibly_orgi_name.sym) { + if self.ctx().is_reserved_word(&possibly_orig_name.sym) { syntax_error!( self, - possibly_orgi_name.span, + possibly_orig_name.span, SyntaxError::ReservedWordInImport ) } return Ok(ImportSpecifier::Named(ImportNamedSpecifier { span: span!(self, start), - local: possibly_orgi_name, + local: possibly_orig_name, imported: None, is_type_only: true, })); @@ -225,7 +225,7 @@ impl<'a, I: Tokens> Parser { return Ok(ImportSpecifier::Named(ImportNamedSpecifier { span: Span::new(start, orig_name.span.hi(), Default::default()), local, - imported: Some(possibly_orgi_name), + imported: Some(possibly_orig_name), is_type_only: true, })); } else { @@ -249,7 +249,7 @@ impl<'a, I: Tokens> Parser { } else { // `import { type xx } from 'mod'` // `import { type xx as yy } from 'mod'` - orig_name = possibly_orgi_name; + orig_name = possibly_orig_name; is_type_only = true; } } @@ -649,13 +649,13 @@ impl<'a, I: Tokens> Parser { // invalid: `export type { type something }` && !type_only { - let possibly_orgi = self.parse_ident_name()?; - if possibly_orgi.sym == js_word!("as") { + let possibly_orig = self.parse_ident_name()?; + if possibly_orig.sym == js_word!("as") { // `export { type as }` if !is!(self, IdentName) { return Ok(ExportNamedSpecifier { span: span!(self, start), - orig: possibly_orgi, + orig: possibly_orig, exported: None, is_type_only: true, }); @@ -669,7 +669,7 @@ impl<'a, I: Tokens> Parser { let exported = self.parse_ident_name()?; return Ok(ExportNamedSpecifier { span: Span::new(start, orig.span.hi(), Default::default()), - orig: possibly_orgi, + orig: possibly_orig, exported: Some(exported), is_type_only: true, }); @@ -694,7 +694,7 @@ impl<'a, I: Tokens> Parser { } else { // `export { type xx }` // `export { type xx as yy }` - orig = possibly_orgi; + orig = possibly_orig; is_type_only = true; } } From 30260ef44735cf2ee02978876e83dda6f3f1c2f9 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Tue, 28 Sep 2021 18:05:35 +0800 Subject: [PATCH 14/17] refactor conditions --- ecmascript/parser/src/parser/stmt/module_item.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index ab941fb014fd..9d2eb8ed6dad 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -190,9 +190,8 @@ impl<'a, I: Tokens> Parser { // `import { type as } from 'mod'` // `import { type as as } from 'mod'` // `import { type as as as } from 'mod'` - if orig_name.sym == js_word!("type") + if self.syntax().typescript() && orig_name.sym == js_word!("type") && is!(self, IdentName) - && self.syntax().typescript() // invalid: `import type { type something } from 'mod'` && !is_type_only_import { @@ -643,9 +642,8 @@ impl<'a, I: Tokens> Parser { // `export { type as }` // `export { type as as }` // `export { type as as as }` - if orig.sym == js_word!("type") + if self.syntax().typescript() && orig.sym == js_word!("type") && is!(self, IdentName) - && self.syntax().typescript() // invalid: `export type { type something }` && !type_only { From a928fc49734a744afd54b1d4106ac2377079cfbf Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Tue, 28 Sep 2021 19:34:02 +0800 Subject: [PATCH 15/17] update error handling --- ecmascript/parser/src/error.rs | 8 ++++ .../parser/src/parser/stmt/module_item.rs | 39 ++++++++++++++----- .../duplicated-type-only/input.ts.stderr | 6 +-- .../duplicated-type-only/input.ts.stderr | 6 +-- 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/ecmascript/parser/src/error.rs b/ecmascript/parser/src/error.rs index a845c4a437a7..0e6cfc9442c0 100644 --- a/ecmascript/parser/src/error.rs +++ b/ecmascript/parser/src/error.rs @@ -218,6 +218,8 @@ pub enum SyntaxError { TS1196, TS1242, TS1243(JsWord, JsWord), + TS2206, + TS2207, TS2369, TS2371, TS2406, @@ -540,6 +542,12 @@ impl SyntaxError { left, right ) .into(), + SyntaxError::TS2206 => "The 'type' modifier cannot be used on a named import when \ + 'import type' is used on its import statement." + .into(), + SyntaxError::TS2207 => "The 'type' modifier cannot be used on a named export when \ + 'export type' is used on its export statement." + .into(), SyntaxError::TS2369 => { "A parameter property is only allowed in a constructor implementation".into() } diff --git a/ecmascript/parser/src/parser/stmt/module_item.rs b/ecmascript/parser/src/parser/stmt/module_item.rs index 9d2eb8ed6dad..fa84ec1db50c 100644 --- a/ecmascript/parser/src/parser/stmt/module_item.rs +++ b/ecmascript/parser/src/parser/stmt/module_item.rs @@ -177,7 +177,7 @@ impl<'a, I: Tokens> Parser { } /// Parse `foo`, `foo2 as bar` in `import { foo, foo2 as bar }` - fn parse_import_specifier(&mut self, is_type_only_import: bool) -> PResult { + fn parse_import_specifier(&mut self, type_only: bool) -> PResult { let start = cur_pos!(self); match cur!(self, false) { Ok(&Word(..)) => { @@ -190,10 +190,9 @@ impl<'a, I: Tokens> Parser { // `import { type as } from 'mod'` // `import { type as as } from 'mod'` // `import { type as as as } from 'mod'` - if self.syntax().typescript() && orig_name.sym == js_word!("type") + if self.syntax().typescript() + && orig_name.sym == js_word!("type") && is!(self, IdentName) - // invalid: `import type { type something } from 'mod'` - && !is_type_only_import { let possibly_orig_name = self.parse_ident_name()?; if possibly_orig_name.sym == js_word!("as") { @@ -207,6 +206,10 @@ impl<'a, I: Tokens> Parser { ) } + if type_only { + self.emit_err(orig_name.span, SyntaxError::TS2206); + } + return Ok(ImportSpecifier::Named(ImportNamedSpecifier { span: span!(self, start), local: possibly_orig_name, @@ -221,6 +224,11 @@ impl<'a, I: Tokens> Parser { // `import { type as as as } from 'mod'` // `import { type as as foo } from 'mod'` let local = self.parse_binding_ident()?.id; + + if type_only { + self.emit_err(orig_name.span, SyntaxError::TS2206); + } + return Ok(ImportSpecifier::Named(ImportNamedSpecifier { span: Span::new(start, orig_name.span.hi(), Default::default()), local, @@ -248,6 +256,10 @@ impl<'a, I: Tokens> Parser { } else { // `import { type xx } from 'mod'` // `import { type xx as yy } from 'mod'` + if type_only { + self.emit_err(orig_name.span, SyntaxError::TS2206); + } + orig_name = possibly_orig_name; is_type_only = true; } @@ -642,15 +654,15 @@ impl<'a, I: Tokens> Parser { // `export { type as }` // `export { type as as }` // `export { type as as as }` - if self.syntax().typescript() && orig.sym == js_word!("type") - && is!(self, IdentName) - // invalid: `export type { type something }` - && !type_only - { + if self.syntax().typescript() && orig.sym == js_word!("type") && is!(self, IdentName) { let possibly_orig = self.parse_ident_name()?; if possibly_orig.sym == js_word!("as") { // `export { type as }` if !is!(self, IdentName) { + if type_only { + self.emit_err(orig.span, SyntaxError::TS2207); + } + return Ok(ExportNamedSpecifier { span: span!(self, start), orig: possibly_orig, @@ -665,6 +677,11 @@ impl<'a, I: Tokens> Parser { // `export { type as as as }` // `export { type as as foo }` let exported = self.parse_ident_name()?; + + if type_only { + self.emit_err(orig.span, SyntaxError::TS2207); + } + return Ok(ExportNamedSpecifier { span: Span::new(start, orig.span.hi(), Default::default()), orig: possibly_orig, @@ -692,6 +709,10 @@ impl<'a, I: Tokens> Parser { } else { // `export { type xx }` // `export { type xx as yy }` + if type_only { + self.emit_err(orig.span, SyntaxError::TS2207); + } + orig = possibly_orig; is_type_only = true; } diff --git a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr index 7fa2e39facfb..207d6eef756a 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts.stderr @@ -1,6 +1,6 @@ -error: Expected ',', got 'something' - --> $DIR/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts:1:20 +error: The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement. + --> $DIR/tests/typescript-errors/type-only-export-specifier/duplicated-type-only/input.ts:1:15 | 1 | export type { type something } - | ^^^^^^^^^ + | ^^^^ diff --git a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr index 7d04b837b151..37a4770c5dd9 100644 --- a/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr +++ b/ecmascript/parser/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts.stderr @@ -1,6 +1,6 @@ -error: Expected ',', got 'something' - --> $DIR/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts:1:20 +error: The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement. + --> $DIR/tests/typescript-errors/type-only-import-specifier/duplicated-type-only/input.ts:1:15 | 1 | import type { type something } from 'mod' - | ^^^^^^^^^ + | ^^^^ From 84cc3fe88257c5efaa8077583fe39f474f1f9c7c Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Tue, 28 Sep 2021 20:10:39 +0800 Subject: [PATCH 16/17] strip type-only specifiers --- ecmascript/codegen/src/lib.rs | 9 +-------- ecmascript/transforms/module/src/import_analysis.rs | 4 +--- ecmascript/transforms/typescript/src/strip.rs | 13 +++++++++++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ecmascript/codegen/src/lib.rs b/ecmascript/codegen/src/lib.rs index 5649547378f1..35683577fcf2 100644 --- a/ecmascript/codegen/src/lib.rs +++ b/ecmascript/codegen/src/lib.rs @@ -184,9 +184,7 @@ impl<'a> Emitter<'a> { for specifier in &node.specifiers { match specifier { ImportSpecifier::Named(ref s) => { - if !s.is_type_only { - specifiers.push(s); - } + specifiers.push(s); } ImportSpecifier::Default(ref s) => { emit!(s.local); @@ -319,11 +317,6 @@ impl<'a> Emitter<'a> { } result } - ExportSpecifier::Named(ExportNamedSpecifier { is_type_only, .. }) - if *is_type_only => - { - result - } spec => { result.has_named_specs = true; result.named_specs.push(spec); diff --git a/ecmascript/transforms/module/src/import_analysis.rs b/ecmascript/transforms/module/src/import_analysis.rs index b796c3a943af..819300c80593 100644 --- a/ecmascript/transforms/module/src/import_analysis.rs +++ b/ecmascript/transforms/module/src/import_analysis.rs @@ -109,8 +109,6 @@ impl Visit for ImportAnalyzer { .entry(import.src.value.clone()) .or_insert(false); } - ImportSpecifier::Named(ImportNamedSpecifier { is_type_only, .. }) - if is_type_only => {} ImportSpecifier::Named(ref i) => { let ImportNamedSpecifier { ref local, @@ -157,7 +155,7 @@ impl Visit for ImportAnalyzer { let mut scope = self.scope.borrow_mut(); for &ExportNamedSpecifier { ref orig, .. } in export.specifiers.iter().filter_map(|e| match *e { - ExportSpecifier::Named(ref e) if !e.is_type_only => Some(e), + ExportSpecifier::Named(ref e) => Some(e), _ => None, }) { diff --git a/ecmascript/transforms/typescript/src/strip.rs b/ecmascript/transforms/typescript/src/strip.rs index 2c4da61c65d4..2e652449c977 100644 --- a/ecmascript/transforms/typescript/src/strip.rs +++ b/ecmascript/transforms/typescript/src/strip.rs @@ -1447,6 +1447,9 @@ impl VisitMut for Strip { self.is_side_effect_import = import.specifiers.is_empty(); import.specifiers.retain(|s| match *s { + ImportSpecifier::Named(ImportNamedSpecifier { + ref is_type_only, .. + }) if *is_type_only => false, ImportSpecifier::Default(ImportDefaultSpecifier { ref local, .. }) | ImportSpecifier::Named(ImportNamedSpecifier { ref local, .. }) | ImportSpecifier::Namespace(ImportStarAsSpecifier { ref local, .. }) => { @@ -1935,8 +1938,14 @@ impl VisitMut for Strip { export.specifiers.clear(); } export.specifiers.retain(|s| match *s { - ExportSpecifier::Named(ExportNamedSpecifier { ref orig, .. }) => { - if let Some(e) = self.scope.decls.get(&orig.to_id()) { + ExportSpecifier::Named(ExportNamedSpecifier { + ref orig, + ref is_type_only, + .. + }) => { + if *is_type_only { + false + } else if let Some(e) = self.scope.decls.get(&orig.to_id()) { e.has_concrete } else { true From 58cadda8e0fd9ad664b9c95aacf705f403596ea8 Mon Sep 17 00:00:00 2001 From: Donny Date: Tue, 28 Sep 2021 21:39:15 +0900 Subject: [PATCH 17/17] Bump version --- Cargo.lock | 54 +++++++++---------- Cargo.toml | 28 +++++----- bundler/Cargo.toml | 18 +++---- ecmascript/Cargo.toml | 20 +++---- ecmascript/ast/Cargo.toml | 2 +- ecmascript/codegen/Cargo.toml | 6 +-- ecmascript/dep-graph/Cargo.toml | 8 +-- ecmascript/ext-transforms/Cargo.toml | 10 ++-- ecmascript/jsdoc/Cargo.toml | 6 +-- ecmascript/loader/Cargo.toml | 6 +-- ecmascript/minifier/Cargo.toml | 16 +++--- ecmascript/parser/Cargo.toml | 6 +-- ecmascript/preset-env/Cargo.toml | 14 ++--- ecmascript/transforms/Cargo.toml | 28 +++++----- ecmascript/transforms/base/Cargo.toml | 12 ++--- ecmascript/transforms/classes/Cargo.toml | 10 ++-- ecmascript/transforms/compat/Cargo.toml | 16 +++--- ecmascript/transforms/module/Cargo.toml | 18 +++---- ecmascript/transforms/optimization/Cargo.toml | 24 ++++----- ecmascript/transforms/proposal/Cargo.toml | 22 ++++---- ecmascript/transforms/react/Cargo.toml | 20 +++---- ecmascript/transforms/testing/Cargo.toml | 14 ++--- ecmascript/transforms/typescript/Cargo.toml | 22 ++++---- ecmascript/utils/Cargo.toml | 6 +-- ecmascript/visit/Cargo.toml | 4 +- plugin/Cargo.toml | 8 +-- plugin/runner/Cargo.toml | 10 ++-- plugin/testing/Cargo.toml | 12 ++--- 28 files changed, 210 insertions(+), 210 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd68fdd9b884..f8658f083a2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -924,7 +924,7 @@ dependencies = [ [[package]] name = "jsdoc" -version = "0.40.0" +version = "0.41.0" dependencies = [ "anyhow", "dashmap", @@ -2305,7 +2305,7 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "swc" -version = "0.58.0" +version = "0.59.0" dependencies = [ "ahash", "anyhow", @@ -2410,7 +2410,7 @@ dependencies = [ [[package]] name = "swc_bundler" -version = "0.61.0" +version = "0.62.0" dependencies = [ "ahash", "anyhow", @@ -2561,7 +2561,7 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.53.0" +version = "0.54.0" dependencies = [ "arbitrary", "is-macro", @@ -2575,7 +2575,7 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "0.72.0" +version = "0.73.0" dependencies = [ "bitflags", "num-bigint", @@ -2601,7 +2601,7 @@ dependencies = [ [[package]] name = "swc_ecma_dep_graph" -version = "0.41.0" +version = "0.42.0" dependencies = [ "swc_atoms 0.2.7", "swc_common", @@ -2613,7 +2613,7 @@ dependencies = [ [[package]] name = "swc_ecma_ext_transforms" -version = "0.30.0" +version = "0.31.0" dependencies = [ "phf", "swc_atoms 0.2.7", @@ -2626,7 +2626,7 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.19.0" +version = "0.20.0" dependencies = [ "anyhow", "dashmap", @@ -2647,7 +2647,7 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.30.1" +version = "0.31.0" dependencies = [ "ansi_term 0.12.1", "anyhow", @@ -2680,7 +2680,7 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.72.0" +version = "0.73.0" dependencies = [ "either", "enum_kind", @@ -2705,7 +2705,7 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.45.0" +version = "0.46.0" dependencies = [ "dashmap", "indexmap", @@ -2731,7 +2731,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.74.0" +version = "0.75.0" dependencies = [ "pretty_assertions 0.6.1", "sourcemap", @@ -2758,7 +2758,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.33.0" +version = "0.34.0" dependencies = [ "once_cell", "phf", @@ -2777,7 +2777,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.19.0" +version = "0.20.0" dependencies = [ "swc_atoms 0.2.7", "swc_common", @@ -2789,7 +2789,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.37.0" +version = "0.38.0" dependencies = [ "arrayvec", "indexmap", @@ -2825,7 +2825,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_module" -version = "0.41.0" +version = "0.42.0" dependencies = [ "Inflector", "anyhow", @@ -2848,7 +2848,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.44.1" +version = "0.45.0" dependencies = [ "dashmap", "indexmap", @@ -2875,7 +2875,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.41.0" +version = "0.42.0" dependencies = [ "either", "rustc-hash", @@ -2900,7 +2900,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.42.0" +version = "0.43.0" dependencies = [ "base64 0.13.0", "dashmap", @@ -2926,7 +2926,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_testing" -version = "0.34.0" +version = "0.35.0" dependencies = [ "ansi_term 0.12.1", "anyhow", @@ -2945,7 +2945,7 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.43.0" +version = "0.44.0" dependencies = [ "rustc-hash", "serde", @@ -2967,7 +2967,7 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.45.0" +version = "0.46.0" dependencies = [ "once_cell", "scoped-tls", @@ -2981,7 +2981,7 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.39.0" +version = "0.40.0" dependencies = [ "num-bigint", "swc_atoms 0.2.7", @@ -2992,7 +2992,7 @@ dependencies = [ [[package]] name = "swc_ecmascript" -version = "0.66.0" +version = "0.67.0" dependencies = [ "swc_ecma_ast", "swc_ecma_codegen", @@ -3069,7 +3069,7 @@ dependencies = [ [[package]] name = "swc_plugin" -version = "0.5.0" +version = "0.6.0" dependencies = [ "abi_stable", "anyhow", @@ -3084,7 +3084,7 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "0.6.0" +version = "0.7.0" dependencies = [ "abi_stable", "anyhow", @@ -3102,7 +3102,7 @@ dependencies = [ [[package]] name = "swc_plugin_testing" -version = "0.6.0" +version = "0.7.0" dependencies = [ "anyhow", "swc_atoms 0.2.7", diff --git a/Cargo.toml b/Cargo.toml index 0805ced40802..9d955ffd7d9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc" repository = "https://github.com/swc-project/swc.git" -version = "0.58.0" +version = "0.59.0" [lib] name = "swc" @@ -52,16 +52,16 @@ serde = {version = "1", features = ["derive"]} serde_json = "1" sourcemap = "6" swc_atoms = {version = "0.2", path = "./atoms"} -swc_bundler = {version = "0.61.0", path = "./bundler"} +swc_bundler = {version = "0.62.0", path = "./bundler"} swc_common = {version = "0.13.0", path = "./common", features = ["sourcemap", "concurrent"]} -swc_ecma_ast = {version = "0.53.0", path = "./ecmascript/ast"} -swc_ecma_codegen = {version = "0.72.0", path = "./ecmascript/codegen"} -swc_ecma_ext_transforms = {version = "0.30.0", path = "./ecmascript/ext-transforms"} -swc_ecma_loader = {version = "0.19.0", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]} -swc_ecma_minifier = {version = "0.30.0", path = "./ecmascript/minifier"} -swc_ecma_parser = {version = "0.72.0", path = "./ecmascript/parser"} -swc_ecma_preset_env = {version = "0.45.0", path = "./ecmascript/preset-env"} -swc_ecma_transforms = {version = "0.74.0", path = "./ecmascript/transforms", features = [ +swc_ecma_ast = {version = "0.54.0", path = "./ecmascript/ast"} +swc_ecma_codegen = {version = "0.73.0", path = "./ecmascript/codegen"} +swc_ecma_ext_transforms = {version = "0.31.0", path = "./ecmascript/ext-transforms"} +swc_ecma_loader = {version = "0.20.0", path = "./ecmascript/loader", features = ["lru", "node", "tsc"]} +swc_ecma_minifier = {version = "0.31.0", path = "./ecmascript/minifier"} +swc_ecma_parser = {version = "0.73.0", path = "./ecmascript/parser"} +swc_ecma_preset_env = {version = "0.46.0", path = "./ecmascript/preset-env"} +swc_ecma_transforms = {version = "0.75.0", path = "./ecmascript/transforms", features = [ "compat", "module", "optimization", @@ -69,10 +69,10 @@ swc_ecma_transforms = {version = "0.74.0", path = "./ecmascript/transforms", fea "react", "typescript", ]} -swc_ecma_transforms_base = {version = "0.33.0", path = "./ecmascript/transforms/base"} -swc_ecma_utils = {version = "0.45.0", path = "./ecmascript/utils"} -swc_ecma_visit = {version = "0.39.0", path = "./ecmascript/visit"} -swc_ecmascript = {version = "0.66.0", path = "./ecmascript"} +swc_ecma_transforms_base = {version = "0.34.0", path = "./ecmascript/transforms/base"} +swc_ecma_utils = {version = "0.46.0", path = "./ecmascript/utils"} +swc_ecma_visit = {version = "0.40.0", path = "./ecmascript/visit"} +swc_ecmascript = {version = "0.67.0", path = "./ecmascript"} swc_visit = {version = "0.2.3", path = "./visit"} tracing = "0.1.28" diff --git a/bundler/Cargo.toml b/bundler/Cargo.toml index 7a285ad05c55..52342490ec40 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.61.0" +version = "0.62.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] @@ -32,13 +32,13 @@ retain_mut = "0.1.2" rustc-hash = "1.1.0" swc_atoms = {version = "0.2.4", path = "../atoms"} swc_common = {version = "0.13.0", path = "../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ecmascript/ast"} -swc_ecma_codegen = {version = "0.72.0", path = "../ecmascript/codegen"} -swc_ecma_loader = {version = "0.19.0", path = "../ecmascript/loader"} -swc_ecma_parser = {version = "0.72.0", path = "../ecmascript/parser"} -swc_ecma_transforms = {version = "0.74.0", path = "../ecmascript/transforms", features = ["optimization"]} -swc_ecma_utils = {version = "0.45.0", path = "../ecmascript/utils"} -swc_ecma_visit = {version = "0.39.0", path = "../ecmascript/visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ecmascript/ast"} +swc_ecma_codegen = {version = "0.73.0", path = "../ecmascript/codegen"} +swc_ecma_loader = {version = "0.20.0", path = "../ecmascript/loader"} +swc_ecma_parser = {version = "0.73.0", path = "../ecmascript/parser"} +swc_ecma_transforms = {version = "0.75.0", path = "../ecmascript/transforms", features = ["optimization"]} +swc_ecma_utils = {version = "0.46.0", path = "../ecmascript/utils"} +swc_ecma_visit = {version = "0.40.0", path = "../ecmascript/visit"} tracing = "0.1.28" [dev-dependencies] @@ -46,7 +46,7 @@ hex = "0.4" ntest = "0.7.2" reqwest = {version = "0.11.4", features = ["blocking"]} sha-1 = "0.9" -swc_ecma_transforms = {version = "0.74.0", path = "../ecmascript/transforms", features = ["react", "typescript"]} +swc_ecma_transforms = {version = "0.75.0", path = "../ecmascript/transforms", features = ["react", "typescript"]} tempfile = "3.1.0" testing = {version = "0.14.0", path = "../testing"} url = "2.1.1" diff --git a/ecmascript/Cargo.toml b/ecmascript/Cargo.toml index 3b8ec559accf..7be56dfe9d0a 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.66.0" +version = "0.67.0" [package.metadata.docs.rs] all-features = true @@ -32,14 +32,14 @@ react = ["swc_ecma_transforms/react"] typescript = ["typescript-parser", "swc_ecma_transforms/typescript"] [dependencies] -swc_ecma_ast = {version = "0.53.0", path = "./ast"} -swc_ecma_codegen = {version = "0.72.0", path = "./codegen", optional = true} -swc_ecma_dep_graph = {version = "0.41.0", path = "./dep-graph", optional = true} -swc_ecma_minifier = {version = "0.30.0", path = "./minifier", optional = true} -swc_ecma_parser = {version = "0.72.0", path = "./parser", optional = true, default-features = false} -swc_ecma_preset_env = {version = "0.45.0", path = "./preset-env", optional = true} -swc_ecma_transforms = {version = "0.74.0", path = "./transforms", optional = true} -swc_ecma_utils = {version = "0.45.0", path = "./utils", optional = true} -swc_ecma_visit = {version = "0.39.0", path = "./visit", optional = true} +swc_ecma_ast = {version = "0.54.0", path = "./ast"} +swc_ecma_codegen = {version = "0.73.0", path = "./codegen", optional = true} +swc_ecma_dep_graph = {version = "0.42.0", path = "./dep-graph", optional = true} +swc_ecma_minifier = {version = "0.31.0", path = "./minifier", optional = true} +swc_ecma_parser = {version = "0.73.0", path = "./parser", optional = true, default-features = false} +swc_ecma_preset_env = {version = "0.46.0", path = "./preset-env", optional = true} +swc_ecma_transforms = {version = "0.75.0", path = "./transforms", optional = true} +swc_ecma_utils = {version = "0.46.0", path = "./utils", optional = true} +swc_ecma_visit = {version = "0.40.0", path = "./visit", optional = true} [dev-dependencies] diff --git a/ecmascript/ast/Cargo.toml b/ecmascript/ast/Cargo.toml index 52fc1d328068..1ada8b68afb1 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.53.0" +version = "0.54.0" [features] default = [] diff --git a/ecmascript/codegen/Cargo.toml b/ecmascript/codegen/Cargo.toml index d4eb14a83c25..44960fa4722a 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.72.0" +version = "0.73.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.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} swc_ecma_codegen_macros = {version = "0.5.2", path = "./macros"} -swc_ecma_parser = {version = "0.72.0", path = "../parser"} +swc_ecma_parser = {version = "0.73.0", path = "../parser"} [dev-dependencies] swc_common = {version = "0.13.0", path = "../../common", features = ["sourcemap"]} diff --git a/ecmascript/dep-graph/Cargo.toml b/ecmascript/dep-graph/Cargo.toml index 8f5df8a8072b..5913195f4fa6 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.41.0" +version = "0.42.0" [dependencies] swc_atoms = {version = "0.2", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} [dev-dependencies] -swc_ecma_parser = {version = "0.72.0", path = "../parser"} +swc_ecma_parser = {version = "0.73.0", path = "../parser"} testing = {version = "0.14.0", path = "../../testing"} diff --git a/ecmascript/ext-transforms/Cargo.toml b/ecmascript/ext-transforms/Cargo.toml index a04651b12243..7f69732479ec 100644 --- a/ecmascript/ext-transforms/Cargo.toml +++ b/ecmascript/ext-transforms/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_ext_transforms/" edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_ext_transforms" -version = "0.30.0" +version = "0.31.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -13,7 +13,7 @@ version = "0.30.0" phf = {version = "0.8.0", features = ["macros"]} swc_atoms = {version = "0.2", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_parser = {version = "0.72.0", path = "../parser"} -swc_ecma_utils = {version = "0.45.0", path = "../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_parser = {version = "0.73.0", path = "../parser"} +swc_ecma_utils = {version = "0.46.0", path = "../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} diff --git a/ecmascript/jsdoc/Cargo.toml b/ecmascript/jsdoc/Cargo.toml index aeea7642db35..ece43ff07eca 100644 --- a/ecmascript/jsdoc/Cargo.toml +++ b/ecmascript/jsdoc/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/jsdoc/" edition = "2018" license = "Apache-2.0/MIT" name = "jsdoc" -version = "0.40.0" +version = "0.41.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.13.0", path = "../../common"} [dev-dependencies] anyhow = "1" dashmap = "4.0.2" -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_parser = {version = "0.72.0", path = "../parser"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_parser = {version = "0.73.0", path = "../parser"} testing = {version = "0.14.0", path = "../../testing"} walkdir = "2" diff --git a/ecmascript/loader/Cargo.toml b/ecmascript/loader/Cargo.toml index e623f2f7cf08..699cb4e56a45 100644 --- a/ecmascript/loader/Cargo.toml +++ b/ecmascript/loader/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_loader" repository = "https://github.com/swc-project/swc.git" -version = "0.19.0" +version = "0.20.0" [package.metadata.docs.rs] all-features = true @@ -30,8 +30,8 @@ serde = {version = "1.0.126", optional = true} serde_json = {version = "1.0.64", optional = true} swc_atoms = {version = "0.2.3", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} tracing = "0.1.28" [dev-dependencies] diff --git a/ecmascript/minifier/Cargo.toml b/ecmascript/minifier/Cargo.toml index d72a5808dc38..04d09da4b5a0 100644 --- a/ecmascript/minifier/Cargo.toml +++ b/ecmascript/minifier/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"] license = "Apache-2.0/MIT" name = "swc_ecma_minifier" repository = "https://github.com/swc-project/swc.git" -version = "0.30.1" +version = "0.31.0" [features] debug = ["backtrace"] @@ -26,13 +26,13 @@ serde_json = "1.0.61" serde_regex = "1.1.0" swc_atoms = {version = "0.2", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_codegen = {version = "0.72.0", path = "../codegen"} -swc_ecma_parser = {version = "0.72.0", path = "../parser"} -swc_ecma_transforms = {version = "0.74.0", path = "../transforms/", features = ["optimization"]} -swc_ecma_transforms_base = {version = "0.33.0", path = "../transforms/base"} -swc_ecma_utils = {version = "0.45.0", path = "../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_codegen = {version = "0.73.0", path = "../codegen"} +swc_ecma_parser = {version = "0.73.0", path = "../parser"} +swc_ecma_transforms = {version = "0.75.0", path = "../transforms/", features = ["optimization"]} +swc_ecma_transforms_base = {version = "0.34.0", path = "../transforms/base"} +swc_ecma_utils = {version = "0.46.0", path = "../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} tracing = "0.1.28" unicode-xid = "0.2.2" diff --git a/ecmascript/parser/Cargo.toml b/ecmascript/parser/Cargo.toml index eacd3562e2a3..4cb0eeeaf29e 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.72.0" +version = "0.73.0" [package.metadata.docs.rs] all-features = true @@ -28,8 +28,8 @@ serde = {version = "1", features = ["derive"]} smallvec = "1" swc_atoms = {version = "0.2.3", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} tracing = "0.1.28" unicode-xid = "0.2" diff --git a/ecmascript/preset-env/Cargo.toml b/ecmascript/preset-env/Cargo.toml index 1a50128ad783..8d2451ba68bd 100644 --- a/ecmascript/preset-env/Cargo.toml +++ b/ecmascript/preset-env/Cargo.toml @@ -5,7 +5,7 @@ documentation = "https://rustdoc.swc.rs/swc_ecma_preset_env/" edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_preset_env" -version = "0.45.0" +version = "0.46.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -21,14 +21,14 @@ st-map = "0.1.2" string_enum = {version = "0.3.1", path = "../../macros/string_enum"} swc_atoms = {version = "0.2", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_transforms = {version = "0.74.0", path = "../transforms", features = ["compat", "proposal"]} -swc_ecma_utils = {version = "0.45.0", path = "../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_transforms = {version = "0.75.0", path = "../transforms", features = ["compat", "proposal"]} +swc_ecma_utils = {version = "0.46.0", path = "../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} walkdir = "2" [dev-dependencies] pretty_assertions = "0.6" -swc_ecma_codegen = {version = "0.72.0", path = "../codegen"} -swc_ecma_parser = {version = "0.72.0", path = "../parser"} +swc_ecma_codegen = {version = "0.73.0", path = "../codegen"} +swc_ecma_parser = {version = "0.73.0", path = "../parser"} testing = {version = "0.14.0", path = "../../testing"} diff --git a/ecmascript/transforms/Cargo.toml b/ecmascript/transforms/Cargo.toml index 0743238547da..57f2da2d700b 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.74.0" +version = "0.75.0" [package.metadata.docs.rs] all-features = true @@ -23,24 +23,24 @@ typescript = ["swc_ecma_transforms_typescript"] [dependencies] swc_atoms = {version = "0.2.0", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_parser = {version = "0.72.0", path = "../parser"} -swc_ecma_transforms_base = {version = "0.33.0", path = "./base"} -swc_ecma_transforms_compat = {version = "0.37.0", path = "./compat", optional = true} -swc_ecma_transforms_module = {version = "0.41.0", path = "./module", optional = true} -swc_ecma_transforms_optimization = {version = "0.44.0", path = "./optimization", optional = true} -swc_ecma_transforms_proposal = {version = "0.41.0", path = "./proposal", optional = true} -swc_ecma_transforms_react = {version = "0.42.0", path = "./react", optional = true} -swc_ecma_transforms_typescript = {version = "0.43.0", path = "./typescript", optional = true} -swc_ecma_utils = {version = "0.45.0", path = "../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_parser = {version = "0.73.0", path = "../parser"} +swc_ecma_transforms_base = {version = "0.34.0", path = "./base"} +swc_ecma_transforms_compat = {version = "0.38.0", path = "./compat", optional = true} +swc_ecma_transforms_module = {version = "0.42.0", path = "./module", optional = true} +swc_ecma_transforms_optimization = {version = "0.45.0", path = "./optimization", optional = true} +swc_ecma_transforms_proposal = {version = "0.42.0", path = "./proposal", optional = true} +swc_ecma_transforms_react = {version = "0.43.0", path = "./react", optional = true} +swc_ecma_transforms_typescript = {version = "0.44.0", path = "./typescript", optional = true} +swc_ecma_utils = {version = "0.46.0", path = "../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] pretty_assertions = "0.6" sourcemap = "6" -swc_ecma_codegen = {version = "0.72.0", path = "../codegen"} -swc_ecma_transforms_testing = {version = "0.34.0", path = "./testing"} +swc_ecma_codegen = {version = "0.73.0", path = "../codegen"} +swc_ecma_transforms_testing = {version = "0.35.0", path = "./testing"} tempfile = "3" testing = {version = "0.14.0", path = "../../testing"} walkdir = "2" diff --git a/ecmascript/transforms/base/Cargo.toml b/ecmascript/transforms/base/Cargo.toml index c72630e5a587..21f0cafefc56 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.33.0" +version = "0.34.0" [dependencies] once_cell = "1.5.2" @@ -16,11 +16,11 @@ scoped-tls = "1.0.0" smallvec = "1.6.0" swc_atoms = {version = "0.2", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} [dev-dependencies] -swc_ecma_codegen = {version = "0.72.0", path = "../../codegen"} +swc_ecma_codegen = {version = "0.73.0", path = "../../codegen"} testing = {version = "0.14.0", path = "../../../testing"} diff --git a/ecmascript/transforms/classes/Cargo.toml b/ecmascript/transforms/classes/Cargo.toml index 020b6f60ba0c..77be7975b3cc 100644 --- a/ecmascript/transforms/classes/Cargo.toml +++ b/ecmascript/transforms/classes/Cargo.toml @@ -6,12 +6,12 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_classes" repository = "https://github.com/swc-project/swc.git" -version = "0.19.0" +version = "0.20.0" [dependencies] swc_atoms = {version = "0.2.6", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} diff --git a/ecmascript/transforms/compat/Cargo.toml b/ecmascript/transforms/compat/Cargo.toml index 3bbc9ab3fee9..1f8f83769ff6 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.37.0" +version = "0.38.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -20,14 +20,14 @@ serde = {version = "1.0.118", features = ["derive"]} smallvec = "1.6.0" swc_atoms = {version = "0.2.5", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_transforms_classes = {version = "0.19.0", path = "../classes"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_transforms_classes = {version = "0.20.0", path = "../classes"} swc_ecma_transforms_macros = {version = "0.2.1", path = "../macros"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} [dev-dependencies] -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_transforms_testing = {version = "0.34.0", path = "../testing"} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_transforms_testing = {version = "0.35.0", path = "../testing"} testing = {version = "0.14.0", path = "../../../testing"} diff --git a/ecmascript/transforms/module/Cargo.toml b/ecmascript/transforms/module/Cargo.toml index 96b0777c37e4..2b3dc1fcd24f 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.41.0" +version = "0.42.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -18,14 +18,14 @@ rustc-hash = "1.1.0" serde = {version = "1.0.118", features = ["derive"]} swc_atoms = {version = "0.2", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_loader = {version = "0.19.0", path = "../../loader", features = ["node"]} -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_loader = {version = "0.20.0", path = "../../loader", features = ["node"]} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.37.0", path = "../compat"} -swc_ecma_transforms_testing = {version = "0.34.0", path = "../testing/"} +swc_ecma_transforms_compat = {version = "0.38.0", path = "../compat"} +swc_ecma_transforms_testing = {version = "0.35.0", path = "../testing/"} testing = {version = "0.14.0", path = "../../../testing/"} diff --git a/ecmascript/transforms/optimization/Cargo.toml b/ecmascript/transforms/optimization/Cargo.toml index d0cc19dd744b..f5865277707f 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.44.1" +version = "0.45.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -18,18 +18,18 @@ rustc-hash = "1.1.0" serde_json = "1.0.61" swc_atoms = {version = "0.2", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} tracing = "0.1.28" [dev-dependencies] -swc_ecma_transforms_compat = {version = "0.37.0", path = "../compat"} -swc_ecma_transforms_module = {version = "0.41.0", path = "../module"} -swc_ecma_transforms_proposal = {version = "0.41.0", path = "../proposal"} -swc_ecma_transforms_react = {version = "0.42.0", path = "../react"} -swc_ecma_transforms_testing = {version = "0.34.0", path = "../testing"} -swc_ecma_transforms_typescript = {version = "0.43.0", path = "../typescript"} +swc_ecma_transforms_compat = {version = "0.38.0", path = "../compat"} +swc_ecma_transforms_module = {version = "0.42.0", path = "../module"} +swc_ecma_transforms_proposal = {version = "0.42.0", path = "../proposal"} +swc_ecma_transforms_react = {version = "0.43.0", path = "../react"} +swc_ecma_transforms_testing = {version = "0.35.0", path = "../testing"} +swc_ecma_transforms_typescript = {version = "0.44.0", path = "../typescript"} testing = {version = "0.14.0", path = "../../../testing"} diff --git a/ecmascript/transforms/proposal/Cargo.toml b/ecmascript/transforms/proposal/Cargo.toml index e950be55ba72..9024935be221 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.41.0" +version = "0.42.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -21,18 +21,18 @@ serde = {version = "1.0.118", features = ["derive"]} smallvec = "1.6.0" swc_atoms = {version = "0.2", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_loader = {version = "0.19.0", path = "../../loader", optional = true} -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_transforms_classes = {version = "0.19.0", path = "../classes"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_loader = {version = "0.20.0", path = "../../loader", optional = true} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_transforms_classes = {version = "0.20.0", path = "../classes"} swc_ecma_transforms_macros = {version = "0.2.1", path = "../macros"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} [dev-dependencies] serde_json = "1.0.66" -swc_ecma_transforms_compat = {version = "0.37.0", path = "../compat"} -swc_ecma_transforms_module = {version = "0.41.0", path = "../module"} -swc_ecma_transforms_testing = {version = "0.34.0", path = "../testing"} +swc_ecma_transforms_compat = {version = "0.38.0", path = "../compat"} +swc_ecma_transforms_module = {version = "0.42.0", path = "../module"} +swc_ecma_transforms_testing = {version = "0.35.0", path = "../testing"} testing = {version = "0.14.0", path = "../../../testing"} diff --git a/ecmascript/transforms/react/Cargo.toml b/ecmascript/transforms/react/Cargo.toml index ff56c2c07fc5..31fe2bc80a85 100644 --- a/ecmascript/transforms/react/Cargo.toml +++ b/ecmascript/transforms/react/Cargo.toml @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs"] license = "Apache-2.0/MIT" name = "swc_ecma_transforms_react" repository = "https://github.com/swc-project/swc.git" -version = "0.42.0" +version = "0.43.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -21,15 +21,15 @@ sha-1 = "0.9.4" string_enum = {version = "0.3.1", path = "../../../macros/string_enum"} swc_atoms = {version = "0.2", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} [dev-dependencies] -swc_ecma_codegen = {version = "0.72.0", path = "../../codegen/"} -swc_ecma_transforms_compat = {version = "0.37.0", path = "../compat/"} -swc_ecma_transforms_module = {version = "0.41.0", path = "../module"} -swc_ecma_transforms_testing = {version = "0.34.0", path = "../testing/"} +swc_ecma_codegen = {version = "0.73.0", path = "../../codegen/"} +swc_ecma_transforms_compat = {version = "0.38.0", path = "../compat/"} +swc_ecma_transforms_module = {version = "0.42.0", path = "../module"} +swc_ecma_transforms_testing = {version = "0.35.0", path = "../testing/"} testing = {version = "0.14.0", path = "../../../testing"} diff --git a/ecmascript/transforms/testing/Cargo.toml b/ecmascript/transforms/testing/Cargo.toml index 229d07ee78a9..93062be686a5 100644 --- a/ecmascript/transforms/testing/Cargo.toml +++ b/ecmascript/transforms/testing/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_testing" repository = "https://github.com/swc-project/swc.git" -version = "0.34.0" +version = "0.35.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -16,11 +16,11 @@ anyhow = "1" serde = "1" serde_json = "1" swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_codegen = {version = "0.72.0", path = "../../codegen"} -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_codegen = {version = "0.73.0", path = "../../codegen"} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} tempfile = "3.1.0" testing = {version = "0.14.0", path = "../../../testing"} diff --git a/ecmascript/transforms/typescript/Cargo.toml b/ecmascript/transforms/typescript/Cargo.toml index 8da4852726a7..f390fe6cd96a 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.43.0" +version = "0.44.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -14,17 +14,17 @@ rustc-hash = "1.1.0" serde = {version = "1.0.118", features = ["derive"]} swc_atoms = {version = "0.2", path = "../../../atoms"} swc_common = {version = "0.13.0", path = "../../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ast"} -swc_ecma_parser = {version = "0.72.0", path = "../../parser"} -swc_ecma_transforms_base = {version = "0.33.0", path = "../base"} -swc_ecma_utils = {version = "0.45.0", path = "../../utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../../ast"} +swc_ecma_parser = {version = "0.73.0", path = "../../parser"} +swc_ecma_transforms_base = {version = "0.34.0", path = "../base"} +swc_ecma_utils = {version = "0.46.0", path = "../../utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../visit"} [dev-dependencies] -swc_ecma_codegen = {version = "0.72.0", path = "../../codegen"} -swc_ecma_transforms_compat = {version = "0.37.0", path = "../compat"} -swc_ecma_transforms_module = {version = "0.41.0", path = "../module"} -swc_ecma_transforms_proposal = {version = "0.41.0", path = "../proposal/"} -swc_ecma_transforms_testing = {version = "0.34.0", path = "../testing"} +swc_ecma_codegen = {version = "0.73.0", path = "../../codegen"} +swc_ecma_transforms_compat = {version = "0.38.0", path = "../compat"} +swc_ecma_transforms_module = {version = "0.42.0", path = "../module"} +swc_ecma_transforms_proposal = {version = "0.42.0", path = "../proposal/"} +swc_ecma_transforms_testing = {version = "0.35.0", path = "../testing"} testing = {version = "0.14.0", path = "../../../testing"} walkdir = "2.3.1" diff --git a/ecmascript/utils/Cargo.toml b/ecmascript/utils/Cargo.toml index a9a0049c6a40..34421e97b0cd 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.45.0" +version = "0.46.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.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} -swc_ecma_visit = {version = "0.39.0", path = "../visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} +swc_ecma_visit = {version = "0.40.0", path = "../visit"} unicode-xid = "0.2" [dev-dependencies] diff --git a/ecmascript/visit/Cargo.toml b/ecmascript/visit/Cargo.toml index 9aae53343ea9..4a04365b4317 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.39.0" +version = "0.40.0" [dependencies] num-bigint = {version = "0.2", features = ["serde"]} swc_atoms = {version = "0.2", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ast"} +swc_ecma_ast = {version = "0.54.0", path = "../ast"} swc_visit = {version = "0.2.3", path = "../../visit"} diff --git a/plugin/Cargo.toml b/plugin/Cargo.toml index 9d97b43d51d6..e90eb0f6e36c 100644 --- a/plugin/Cargo.toml +++ b/plugin/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_plugin" repository = "https://github.com/swc-project/swc.git" -version = "0.5.0" +version = "0.6.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -17,6 +17,6 @@ serde = "1.0.126" serde_json = "1.0.64" swc_atoms = {version = "0.2.7", path = "../atoms"} swc_common = {version = "0.13.0", path = "../common"} -swc_ecma_ast = {version = "0.53.0", path = "../ecmascript/ast"} -swc_ecma_utils = {version = "0.45.0", path = "../ecmascript/utils"} -swc_ecma_visit = {version = "0.39.0", path = "../ecmascript/visit"} +swc_ecma_ast = {version = "0.54.0", path = "../ecmascript/ast"} +swc_ecma_utils = {version = "0.46.0", path = "../ecmascript/utils"} +swc_ecma_visit = {version = "0.40.0", path = "../ecmascript/visit"} diff --git a/plugin/runner/Cargo.toml b/plugin/runner/Cargo.toml index 925047eb0e18..1ec4891ece3e 100644 --- a/plugin/runner/Cargo.toml +++ b/plugin/runner/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_plugin_runner" repository = "https://github.com/swc-project/swc.git" -version = "0.6.0" +version = "0.7.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] @@ -17,10 +17,10 @@ serde = {version = "1.0.126", features = ["derive"]} serde_json = "1.0.64" swc_atoms = "0.2.7" swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ecmascript/ast"} -swc_ecma_parser = {version = "0.72.0", path = "../../ecmascript/parser"} -swc_plugin = {version = "0.5.0", path = "../"} +swc_ecma_ast = {version = "0.54.0", path = "../../ecmascript/ast"} +swc_ecma_parser = {version = "0.73.0", path = "../../ecmascript/parser"} +swc_plugin = {version = "0.6.0", path = "../"} [dev-dependencies] -swc_ecma_codegen = {version = "0.72.0", path = "../../ecmascript/codegen"} +swc_ecma_codegen = {version = "0.73.0", path = "../../ecmascript/codegen"} testing = {version = "0.14.0", path = "../../testing"} diff --git a/plugin/testing/Cargo.toml b/plugin/testing/Cargo.toml index cbbab19cc54c..2d176e70199e 100644 --- a/plugin/testing/Cargo.toml +++ b/plugin/testing/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_plugin_testing" repository = "https://github.com/swc-project/swc.git" -version = "0.6.0" +version = "0.7.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -14,8 +14,8 @@ version = "0.6.0" anyhow = "1.0.41" swc_atoms = {version = "0.2.7", path = "../../atoms"} swc_common = {version = "0.13.0", path = "../../common"} -swc_ecma_ast = {version = "0.53.0", path = "../../ecmascript/ast"} -swc_ecma_codegen = {version = "0.72.0", path = "../../ecmascript/codegen"} -swc_ecma_utils = {version = "0.45.0", path = "../../ecmascript/utils"} -swc_ecma_visit = {version = "0.39.0", path = "../../ecmascript/visit"} -swc_plugin = {version = "0.5.0", path = "../"} +swc_ecma_ast = {version = "0.54.0", path = "../../ecmascript/ast"} +swc_ecma_codegen = {version = "0.73.0", path = "../../ecmascript/codegen"} +swc_ecma_utils = {version = "0.46.0", path = "../../ecmascript/utils"} +swc_ecma_visit = {version = "0.40.0", path = "../../ecmascript/visit"} +swc_plugin = {version = "0.6.0", path = "../"}