forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix merging of JS value & TS type decl
Fixes microsoft#38383
- Loading branch information
1 parent
077a2a9
commit 4ee013d
Showing
4 changed files
with
53 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.symbols
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
=== /x.js === | ||
module.exports.x = 1; | ||
>module.exports.x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) | ||
>module.exports : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) | ||
>module : Symbol(module, Decl(x.js, 0, 0)) | ||
>exports : Symbol("/x", Decl(x.js, 0, 0)) | ||
>x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) | ||
|
||
module.exports = require("./y.js"); | ||
>module.exports : Symbol("/x", Decl(x.js, 0, 0)) | ||
>module : Symbol(export=, Decl(x.js, 0, 21)) | ||
>exports : Symbol(export=, Decl(x.js, 0, 21)) | ||
>require : Symbol(require) | ||
>"./y.js" : Symbol("/y", Decl(y.d.ts, 0, 0)) | ||
|
||
=== /y.d.ts === | ||
export declare type x = 1; | ||
>x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) | ||
|
23 changes: 23 additions & 0 deletions
23
tests/baselines/reference/jsExportMemberMergedWithModuleAugmentation3.types
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
=== /x.js === | ||
module.exports.x = 1; | ||
>module.exports.x = 1 : 1 | ||
>module.exports.x : number | ||
>module.exports : typeof import("/y") | ||
>module : { "\"/x\"": typeof import("/y"); } | ||
>exports : typeof import("/y") | ||
>x : number | ||
>1 : 1 | ||
|
||
module.exports = require("./y.js"); | ||
>module.exports = require("./y.js") : typeof import("/y") | ||
>module.exports : typeof import("/y") | ||
>module : { "\"/x\"": typeof import("/y"); } | ||
>exports : typeof import("/y") | ||
>require("./y.js") : typeof import("/y") | ||
>require : any | ||
>"./y.js" : "./y.js" | ||
|
||
=== /y.d.ts === | ||
export declare type x = 1; | ||
>x : 1 | ||
|
10 changes: 10 additions & 0 deletions
10
tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation3.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @noEmit: true | ||
|
||
// @Filename: /x.js | ||
module.exports.x = 1; | ||
module.exports = require("./y.js"); | ||
|
||
// @Filename: /y.d.ts | ||
export declare type x = 1; |