-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ts] Strip type-only namespaces (#15799)
- Loading branch information
1 parent
12dfea7
commit 36acc87
Showing
21 changed files
with
280 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/babel-plugin-transform-typescript/test/fixtures/namespace/clobber-export/input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export class N {} | ||
export namespace N {} | ||
export namespace N { var x; } | ||
export default N; |
4 changes: 3 additions & 1 deletion
4
packages/babel-plugin-transform-typescript/test/fixtures/namespace/clobber-export/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export class N {} | ||
(function (_N) {})(N || (N = {})); | ||
(function (_N) { | ||
var x; | ||
})(N || (N = {})); | ||
export default N; |
2 changes: 1 addition & 1 deletion
2
packages/babel-plugin-transform-typescript/test/fixtures/namespace/clobber-import/input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import N from 'n'; | ||
|
||
namespace N {} | ||
namespace N { var x } |
4 changes: 3 additions & 1 deletion
4
packages/babel-plugin-transform-typescript/test/fixtures/namespace/clobber-import/output.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
import N from 'n'; | ||
(function (_N) {})(N || (N = {})); | ||
(function (_N) { | ||
var x; | ||
})(N || (N = {})); |
68 changes: 34 additions & 34 deletions
68
...ages/babel-plugin-transform-typescript/test/fixtures/namespace/contentious-names/input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
namespace N { | ||
namespace N {} | ||
namespace constructor {} | ||
namespace length {} | ||
namespace concat {} | ||
namespace copyWithin {} | ||
namespace fill {} | ||
namespace find {} | ||
namespace findIndex {} | ||
namespace lastIndexOf {} | ||
namespace pop {} | ||
namespace push {} | ||
namespace reverse {} | ||
namespace shift {} | ||
namespace unshift {} | ||
namespace slice {} | ||
namespace sort {} | ||
namespace splice {} | ||
namespace includes {} | ||
namespace indexOf {} | ||
namespace join {} | ||
namespace keys {} | ||
namespace entries {} | ||
namespace values {} | ||
namespace forEach {} | ||
namespace filter {} | ||
namespace map {} | ||
namespace every {} | ||
namespace some {} | ||
namespace reduce {} | ||
namespace reduceRight {} | ||
namespace toLocaleString {} | ||
namespace toString {} | ||
namespace flat {} | ||
namespace flatMap {} | ||
namespace N { var x } | ||
namespace constructor { var x } | ||
namespace length { var x } | ||
namespace concat { var x } | ||
namespace copyWithin { var x } | ||
namespace fill { var x } | ||
namespace find { var x } | ||
namespace findIndex { var x } | ||
namespace lastIndexOf { var x } | ||
namespace pop { var x } | ||
namespace push { var x } | ||
namespace reverse { var x } | ||
namespace shift { var x } | ||
namespace unshift { var x } | ||
namespace slice { var x } | ||
namespace sort { var x } | ||
namespace splice { var x } | ||
namespace includes { var x } | ||
namespace indexOf { var x } | ||
namespace join { var x } | ||
namespace keys { var x } | ||
namespace entries { var x } | ||
namespace values { var x } | ||
namespace forEach { var x } | ||
namespace filter { var x } | ||
namespace map { var x } | ||
namespace every { var x } | ||
namespace some { var x } | ||
namespace reduce { var x } | ||
namespace reduceRight { var x } | ||
namespace toLocaleString { var x } | ||
namespace toString { var x } | ||
namespace flat { var x } | ||
namespace flatMap { var x } | ||
} |
Oops, something went wrong.