Skip to content

Commit dd2b244

Browse files
authored
Add regression test for #38834 (#39479)
1 parent 0f86c04 commit dd2b244

4 files changed

+80
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//// [index.js]
2+
export const colors = {
3+
royalBlue: "#6400e4",
4+
};
5+
6+
export const brandColors = {
7+
purple: colors.royalBlue,
8+
};
9+
10+
//// [index.js]
11+
export const colors = {
12+
royalBlue: "#6400e4",
13+
};
14+
export const brandColors = {
15+
purple: colors.royalBlue,
16+
};
17+
18+
19+
//// [index.d.ts]
20+
export namespace colors {
21+
const royalBlue: string;
22+
}
23+
export namespace brandColors {
24+
import purple = colors.royalBlue;
25+
export { purple };
26+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=== tests/cases/conformance/jsdoc/declarations/index.js ===
2+
export const colors = {
3+
>colors : Symbol(colors, Decl(index.js, 0, 12))
4+
5+
royalBlue: "#6400e4",
6+
>royalBlue : Symbol(royalBlue, Decl(index.js, 0, 23))
7+
8+
};
9+
10+
export const brandColors = {
11+
>brandColors : Symbol(brandColors, Decl(index.js, 4, 12))
12+
13+
purple: colors.royalBlue,
14+
>purple : Symbol(purple, Decl(index.js, 4, 28))
15+
>colors.royalBlue : Symbol(royalBlue, Decl(index.js, 0, 23))
16+
>colors : Symbol(colors, Decl(index.js, 0, 12))
17+
>royalBlue : Symbol(royalBlue, Decl(index.js, 0, 23))
18+
19+
};
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=== tests/cases/conformance/jsdoc/declarations/index.js ===
2+
export const colors = {
3+
>colors : { royalBlue: string; }
4+
>{ royalBlue: "#6400e4",} : { royalBlue: string; }
5+
6+
royalBlue: "#6400e4",
7+
>royalBlue : string
8+
>"#6400e4" : "#6400e4"
9+
10+
};
11+
12+
export const brandColors = {
13+
>brandColors : { purple: string; }
14+
>{ purple: colors.royalBlue,} : { purple: string; }
15+
16+
purple: colors.royalBlue,
17+
>purple : string
18+
>colors.royalBlue : string
19+
>colors : { royalBlue: string; }
20+
>royalBlue : string
21+
22+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// @allowJs: true
2+
// @checkJs: true
3+
// @outDir: ./out
4+
// @target: es6
5+
// @declaration: true
6+
// @filename: index.js
7+
export const colors = {
8+
royalBlue: "#6400e4",
9+
};
10+
11+
export const brandColors = {
12+
purple: colors.royalBlue,
13+
};

0 commit comments

Comments
 (0)