mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge pull request #26751 from Microsoft/declarationEmitWithComposite
Correctly mark visibile nodes when declaration isnt explicitly turned on but composite is true
This commit is contained in:
@@ -26356,7 +26356,7 @@ namespace ts {
|
||||
|
||||
function checkExportSpecifier(node: ExportSpecifier) {
|
||||
checkAliasSymbol(node);
|
||||
if (compilerOptions.declaration) {
|
||||
if (getEmitDeclarations(compilerOptions)) {
|
||||
collectLinkedAliases(node.propertyName || node.name, /*setVisibility*/ true);
|
||||
}
|
||||
if (!node.parent.parent.moduleSpecifier) {
|
||||
@@ -26397,7 +26397,7 @@ namespace ts {
|
||||
if (node.expression.kind === SyntaxKind.Identifier) {
|
||||
markExportAsReferenced(node);
|
||||
|
||||
if (compilerOptions.declaration) {
|
||||
if (getEmitDeclarations(compilerOptions)) {
|
||||
collectLinkedAliases(node.expression as Identifier, /*setVisibility*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
17
tests/baselines/reference/declarationEmitWithComposite.js
Normal file
17
tests/baselines/reference/declarationEmitWithComposite.js
Normal file
@@ -0,0 +1,17 @@
|
||||
//// [test.ts]
|
||||
interface Foo {
|
||||
x: number;
|
||||
}
|
||||
export default Foo;
|
||||
|
||||
|
||||
//// [/foo/out/test.js]
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
|
||||
|
||||
//// [/foo/out/test.d.ts]
|
||||
interface Foo {
|
||||
x: number;
|
||||
}
|
||||
export default Foo;
|
||||
@@ -0,0 +1,10 @@
|
||||
=== /foo/test.ts ===
|
||||
interface Foo {
|
||||
>Foo : Symbol(Foo, Decl(test.ts, 0, 0))
|
||||
|
||||
x: number;
|
||||
>x : Symbol(Foo.x, Decl(test.ts, 0, 15))
|
||||
}
|
||||
export default Foo;
|
||||
>Foo : Symbol(Foo, Decl(test.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== /foo/test.ts ===
|
||||
interface Foo {
|
||||
x: number;
|
||||
>x : number
|
||||
}
|
||||
export default Foo;
|
||||
>Foo : Foo
|
||||
|
||||
13
tests/cases/compiler/declarationEmitWithComposite.ts
Normal file
13
tests/cases/compiler/declarationEmitWithComposite.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
// @composite: true
|
||||
// @fullEmitPaths: true
|
||||
|
||||
// @filename: /foo/tsconfig.json
|
||||
{
|
||||
"compilerOptions": { "composite": true, "outDir": "out" }
|
||||
}
|
||||
|
||||
// @filename: /foo/test.ts
|
||||
interface Foo {
|
||||
x: number;
|
||||
}
|
||||
export default Foo;
|
||||
Reference in New Issue
Block a user