From 6366d05fd31b15d195d464fc253e7ac96a5cc80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 12 Oct 2021 01:27:57 +0900 Subject: [PATCH] fix(es): Fix bugs (#2403) swc: - Ensure that #2114 is fixed. - Ensure that #2310 is fixed. --- tests/fixture/issue-2214/input/.swcrc | 8 ++++++++ tests/fixture/issue-2214/input/index.tsx | 5 +++++ tests/fixture/issue-2214/output/index.tsx | 6 ++++++ tests/fixture/issue-2310/input/index.tsx | 5 +++++ tests/fixture/issue-2310/output/index.tsx | 7 +++++++ 5 files changed, 31 insertions(+) create mode 100644 tests/fixture/issue-2214/input/.swcrc create mode 100644 tests/fixture/issue-2214/input/index.tsx create mode 100644 tests/fixture/issue-2214/output/index.tsx create mode 100644 tests/fixture/issue-2310/input/index.tsx create mode 100644 tests/fixture/issue-2310/output/index.tsx diff --git a/tests/fixture/issue-2214/input/.swcrc b/tests/fixture/issue-2214/input/.swcrc new file mode 100644 index 000000000000..e6de27db0882 --- /dev/null +++ b/tests/fixture/issue-2214/input/.swcrc @@ -0,0 +1,8 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": true + } + } +} \ No newline at end of file diff --git a/tests/fixture/issue-2214/input/index.tsx b/tests/fixture/issue-2214/input/index.tsx new file mode 100644 index 000000000000..48ccf41c4d98 --- /dev/null +++ b/tests/fixture/issue-2214/input/index.tsx @@ -0,0 +1,5 @@ +import React from "react"; + +export module Test { + export const content =
Content
; +} diff --git a/tests/fixture/issue-2214/output/index.tsx b/tests/fixture/issue-2214/output/index.tsx new file mode 100644 index 000000000000..14a02dbbdb27 --- /dev/null +++ b/tests/fixture/issue-2214/output/index.tsx @@ -0,0 +1,6 @@ +import React from "react"; +export var Test; +(function(Test) { + Test.content = /*#__PURE__*/ React.createElement("div", null, "Content"); +})(Test || (Test = { +})); diff --git a/tests/fixture/issue-2310/input/index.tsx b/tests/fixture/issue-2310/input/index.tsx new file mode 100644 index 000000000000..a61d392d479c --- /dev/null +++ b/tests/fixture/issue-2310/input/index.tsx @@ -0,0 +1,5 @@ +namespace A { + export const Foo = () => { + return
; + }; +} diff --git a/tests/fixture/issue-2310/output/index.tsx b/tests/fixture/issue-2310/output/index.tsx new file mode 100644 index 000000000000..688f7077c0f4 --- /dev/null +++ b/tests/fixture/issue-2310/output/index.tsx @@ -0,0 +1,7 @@ +var A; +(function(A) { + A.Foo = function() { + return(/*#__PURE__*/ React.createElement("div", null)); + }; +})(A || (A = { +}));