Skip to content

Commit 7ae4ff3

Browse files
author
Kanchalai Tanglertsampan
committed
Add tests and update baselines
1 parent e5f482d commit 7ae4ff3

8 files changed

+83
-4
lines changed

tests/baselines/reference/checkJsdocTypeTag1.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ x1(0);
2828

2929
/** @type {function (number): number} */
3030
const x2 = (a) => a + 1;
31-
x2(0);
31+
x2(0);
32+
33+
/**
34+
* @type {object}
35+
*/
36+
var props = {};
37+
38+
/**
39+
* @type {Object}
40+
*/
41+
var props = {};
3242

3343
//// [0.js]
3444
// @ts-check
@@ -54,3 +64,11 @@ x1(0);
5464
/** @type {function (number): number} */
5565
var x2 = function (a) { return a + 1; };
5666
x2(0);
67+
/**
68+
* @type {object}
69+
*/
70+
var props = {};
71+
/**
72+
* @type {Object}
73+
*/
74+
var props = {};

tests/baselines/reference/checkJsdocTypeTag1.symbols

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,15 @@ const x2 = (a) => a + 1;
5858
x2(0);
5959
>x2 : Symbol(x2, Decl(0.js, 28, 5))
6060

61+
/**
62+
* @type {object}
63+
*/
64+
var props = {};
65+
>props : Symbol(props, Decl(0.js, 34, 3), Decl(0.js, 39, 3))
66+
67+
/**
68+
* @type {Object}
69+
*/
70+
var props = {};
71+
>props : Symbol(props, Decl(0.js, 34, 3), Decl(0.js, 39, 3))
72+

tests/baselines/reference/checkJsdocTypeTag1.types

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,17 @@ x2(0);
8686
>x2 : (arg0: number) => number
8787
>0 : 0
8888

89+
/**
90+
* @type {object}
91+
*/
92+
var props = {};
93+
>props : any
94+
>{} : {}
95+
96+
/**
97+
* @type {Object}
98+
*/
99+
var props = {};
100+
>props : any
101+
>{} : {}
102+

tests/baselines/reference/jsdocTypeTag.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ var nullable;
5555
/** @type {Object} */
5656
var Obj;
5757

58+
/** @type {object} */
59+
var obj;
60+
5861
/** @type {Function} */
5962
var Func;
6063

@@ -77,6 +80,7 @@ var P: Promise<any>;
7780
var p: Promise<any>;
7881
var nullable: number | null;
7982
var Obj: any;
83+
var obj: any;
8084
var Func: Function;
8185

8286

@@ -117,6 +121,8 @@ var p;
117121
var nullable;
118122
/** @type {Object} */
119123
var Obj;
124+
/** @type {object} */
125+
var obj;
120126
/** @type {Function} */
121127
var Func;
122128
//// [b.js]
@@ -138,4 +144,5 @@ var P;
138144
var p;
139145
var nullable;
140146
var Obj;
147+
var obj;
141148
var Func;

tests/baselines/reference/jsdocTypeTag.symbols

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ var nullable;
7171
var Obj;
7272
>Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3))
7373

74+
/** @type {object} */
75+
var obj;
76+
>obj : Symbol(obj, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
77+
7478
/** @type {Function} */
7579
var Func;
76-
>Func : Symbol(Func, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
80+
>Func : Symbol(Func, Decl(a.js, 58, 3), Decl(b.ts, 19, 3))
7781

7882
=== tests/cases/conformance/jsdoc/b.ts ===
7983
var S: string;
@@ -132,7 +136,10 @@ var nullable: number | null;
132136
var Obj: any;
133137
>Obj : Symbol(Obj, Decl(a.js, 52, 3), Decl(b.ts, 17, 3))
134138

139+
var obj: any;
140+
>obj : Symbol(obj, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
141+
135142
var Func: Function;
136-
>Func : Symbol(Func, Decl(a.js, 55, 3), Decl(b.ts, 18, 3))
143+
>Func : Symbol(Func, Decl(a.js, 58, 3), Decl(b.ts, 19, 3))
137144
>Function : Symbol(Function, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
138145

tests/baselines/reference/jsdocTypeTag.types

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ var nullable;
7171
var Obj;
7272
>Obj : any
7373

74+
/** @type {object} */
75+
var obj;
76+
>obj : any
77+
7478
/** @type {Function} */
7579
var Func;
7680
>Func : Function
@@ -135,6 +139,9 @@ var nullable: number | null;
135139
var Obj: any;
136140
>Obj : any
137141

142+
var obj: any;
143+
>obj : any
144+
138145
var Func: Function;
139146
>Func : Function
140147
>Function : Function

tests/cases/conformance/jsdoc/checkJsdocTypeTag1.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,14 @@ x1(0);
3131

3232
/** @type {function (number): number} */
3333
const x2 = (a) => a + 1;
34-
x2(0);
34+
x2(0);
35+
36+
/**
37+
* @type {object}
38+
*/
39+
var props = {};
40+
41+
/**
42+
* @type {Object}
43+
*/
44+
var props = {};

tests/cases/conformance/jsdoc/jsdocTypeTag.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ var nullable;
5757
/** @type {Object} */
5858
var Obj;
5959

60+
/** @type {object} */
61+
var obj;
62+
6063
/** @type {Function} */
6164
var Func;
6265

@@ -79,4 +82,5 @@ var P: Promise<any>;
7982
var p: Promise<any>;
8083
var nullable: number | null;
8184
var Obj: any;
85+
var obj: any;
8286
var Func: Function;

0 commit comments

Comments
 (0)