Skip to content

Commit 8ae2fba

Browse files
author
Yui T
committed
Add tests and baselines
1 parent d68038a commit 8ae2fba

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

tests/baselines/reference/checkJsdocTypedefInParamTag1.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* @typedef {Object} Opts
55
* @property {string} x
66
* @property {string=} y
7+
* @property {string} [z]
8+
* @property {string} [w="hi"]
79
*
810
* @param {Opts} opts
911
*/
@@ -17,6 +19,8 @@ foo({x: 'abc'});
1719
* @typedef {Object} Opts
1820
* @property {string} x
1921
* @property {string=} y
22+
* @property {string} [z]
23+
* @property {string} [w="hi"]
2024
*
2125
* @param {Opts} opts
2226
*/

tests/baselines/reference/checkJsdocTypedefInParamTag1.symbols

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
* @typedef {Object} Opts
55
* @property {string} x
66
* @property {string=} y
7+
* @property {string} [z]
8+
* @property {string} [w="hi"]
79
*
810
* @param {Opts} opts
911
*/
1012
function foo(opts) {}
1113
>foo : Symbol(foo, Decl(0.js, 0, 0))
12-
>opts : Symbol(opts, Decl(0.js, 8, 13))
14+
>opts : Symbol(opts, Decl(0.js, 10, 13))
1315

1416
foo({x: 'abc'});
1517
>foo : Symbol(foo, Decl(0.js, 0, 0))
16-
>x : Symbol(x, Decl(0.js, 10, 5))
18+
>x : Symbol(x, Decl(0.js, 12, 5))
1719

tests/baselines/reference/checkJsdocTypedefInParamTag1.types

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@
44
* @typedef {Object} Opts
55
* @property {string} x
66
* @property {string=} y
7+
* @property {string} [z]
8+
* @property {string} [w="hi"]
79
*
810
* @param {Opts} opts
911
*/
1012
function foo(opts) {}
11-
>foo : (opts: { x: string; y?: string; }) => void
12-
>opts : { x: string; y?: string; }
13+
>foo : (opts: { x: string; y?: string; z?: string; w?: string; }) => void
14+
>opts : { x: string; y?: string; z?: string; w?: string; }
1315

1416
foo({x: 'abc'});
1517
>foo({x: 'abc'}) : void
16-
>foo : (opts: { x: string; y?: string; }) => void
18+
>foo : (opts: { x: string; y?: string; z?: string; w?: string; }) => void
1719
>{x: 'abc'} : { x: string; }
1820
>x : string
1921
>'abc' : "abc"

tests/cases/conformance/jsdoc/checkJsdocTypedefInParamTag1.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* @typedef {Object} Opts
88
* @property {string} x
99
* @property {string=} y
10+
* @property {string} [z]
11+
* @property {string} [w="hi"]
1012
*
1113
* @param {Opts} opts
1214
*/

0 commit comments

Comments
 (0)