-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle missing return type nodes and nested type references missing t…
…ype arguments in existing jsdoc node serialization (#39011) * Handle missing return type nodes and nested type references missing type arguments in existing jsdoc node serialization * Accept updated baselines
- Loading branch information
Showing
6 changed files
with
147 additions
and
4 deletions.
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
59 changes: 59 additions & 0 deletions
59
tests/baselines/reference/jsDeclarationsMissingTypeParameters.js
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,59 @@ | ||
//// [file.js] | ||
/** | ||
* @param {Array=} y desc | ||
*/ | ||
function x(y) { } | ||
|
||
// @ts-ignore | ||
/** @param {function (Array)} func Invoked | ||
*/ | ||
function y(func) { return; } | ||
|
||
/** | ||
* @return {(Array.<> | null)} list of devices | ||
*/ | ||
function z() { return null ;} | ||
|
||
/** | ||
* | ||
* @return {?Promise} A promise | ||
*/ | ||
function w() { return null; } | ||
|
||
//// [file.js] | ||
/** | ||
* @param {Array=} y desc | ||
*/ | ||
function x(y) { } | ||
// @ts-ignore | ||
/** @param {function (Array)} func Invoked | ||
*/ | ||
function y(func) { return; } | ||
/** | ||
* @return {(Array.<> | null)} list of devices | ||
*/ | ||
function z() { return null; } | ||
/** | ||
* | ||
* @return {?Promise} A promise | ||
*/ | ||
function w() { return null; } | ||
|
||
|
||
//// [file.d.ts] | ||
/** | ||
* @param {Array=} y desc | ||
*/ | ||
declare function x(y?: any[] | undefined): void; | ||
/** @param {function (Array)} func Invoked | ||
*/ | ||
declare function y(func: (arg0: any[]) => any): void; | ||
/** | ||
* @return {(Array.<> | null)} list of devices | ||
*/ | ||
declare function z(): (any[] | null); | ||
/** | ||
* | ||
* @return {?Promise} A promise | ||
*/ | ||
declare function w(): Promise<any> | null; |
28 changes: 28 additions & 0 deletions
28
tests/baselines/reference/jsDeclarationsMissingTypeParameters.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,28 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/file.js === | ||
/** | ||
* @param {Array=} y desc | ||
*/ | ||
function x(y) { } | ||
>x : Symbol(x, Decl(file.js, 0, 0)) | ||
>y : Symbol(y, Decl(file.js, 3, 11)) | ||
|
||
// @ts-ignore | ||
/** @param {function (Array)} func Invoked | ||
*/ | ||
function y(func) { return; } | ||
>y : Symbol(y, Decl(file.js, 3, 17)) | ||
>func : Symbol(func, Decl(file.js, 8, 11)) | ||
|
||
/** | ||
* @return {(Array.<> | null)} list of devices | ||
*/ | ||
function z() { return null ;} | ||
>z : Symbol(z, Decl(file.js, 8, 28)) | ||
|
||
/** | ||
* | ||
* @return {?Promise} A promise | ||
*/ | ||
function w() { return null; } | ||
>w : Symbol(w, Decl(file.js, 13, 29)) | ||
|
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/jsDeclarationsMissingTypeParameters.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,30 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/file.js === | ||
/** | ||
* @param {Array=} y desc | ||
*/ | ||
function x(y) { } | ||
>x : (y?: any[] | undefined) => void | ||
>y : any[] | ||
|
||
// @ts-ignore | ||
/** @param {function (Array)} func Invoked | ||
*/ | ||
function y(func) { return; } | ||
>y : (func: (arg0: any[]) => any) => void | ||
>func : (arg0: any[]) => any | ||
|
||
/** | ||
* @return {(Array.<> | null)} list of devices | ||
*/ | ||
function z() { return null ;} | ||
>z : () => (any[] | null) | ||
>null : null | ||
|
||
/** | ||
* | ||
* @return {?Promise} A promise | ||
*/ | ||
function w() { return null; } | ||
>w : () => Promise<any> | null | ||
>null : null | ||
|
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
26 changes: 26 additions & 0 deletions
26
tests/cases/conformance/jsdoc/declarations/jsDeclarationsMissingTypeParameters.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,26 @@ | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @target: es5 | ||
// @outDir: ./out | ||
// @declaration: true | ||
// @filename: file.js | ||
/** | ||
* @param {Array=} y desc | ||
*/ | ||
function x(y) { } | ||
|
||
// @ts-ignore | ||
/** @param {function (Array)} func Invoked | ||
*/ | ||
function y(func) { return; } | ||
|
||
/** | ||
* @return {(Array.<> | null)} list of devices | ||
*/ | ||
function z() { return null ;} | ||
|
||
/** | ||
* | ||
* @return {?Promise} A promise | ||
*/ | ||
function w() { return null; } |