forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix js missing type arguments on existing nodes and jsdoc object lite…
…ral declaration emit
- Loading branch information
Showing
15 changed files
with
306 additions
and
18 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
30 changes: 30 additions & 0 deletions
30
tests/baselines/reference/jsDeclarationsMissingGenerics.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,30 @@ | ||
//// [file.js] | ||
/** | ||
* @param {Array} x | ||
*/ | ||
function x(x) {} | ||
/** | ||
* @param {Promise} x | ||
*/ | ||
function y(x) {} | ||
|
||
//// [file.js] | ||
/** | ||
* @param {Array} x | ||
*/ | ||
function x(x) { } | ||
/** | ||
* @param {Promise} x | ||
*/ | ||
function y(x) { } | ||
|
||
|
||
//// [file.d.ts] | ||
/** | ||
* @param {Array} x | ||
*/ | ||
declare function x(x: any[]): void; | ||
/** | ||
* @param {Promise} x | ||
*/ | ||
declare function y(x: Promise<any>): void; |
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/jsDeclarationsMissingGenerics.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,15 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/file.js === | ||
/** | ||
* @param {Array} x | ||
*/ | ||
function x(x) {} | ||
>x : Symbol(x, Decl(file.js, 0, 0)) | ||
>x : Symbol(x, Decl(file.js, 3, 11)) | ||
|
||
/** | ||
* @param {Promise} x | ||
*/ | ||
function y(x) {} | ||
>y : Symbol(y, Decl(file.js, 3, 16)) | ||
>x : Symbol(x, Decl(file.js, 7, 11)) | ||
|
15 changes: 15 additions & 0 deletions
15
tests/baselines/reference/jsDeclarationsMissingGenerics.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,15 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/file.js === | ||
/** | ||
* @param {Array} x | ||
*/ | ||
function x(x) {} | ||
>x : (x: any[]) => void | ||
>x : any[] | ||
|
||
/** | ||
* @param {Promise} x | ||
*/ | ||
function y(x) {} | ||
>y : (x: Promise<any>) => void | ||
>x : Promise<any> | ||
|
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,96 @@ | ||
//// [file.js] | ||
class X { | ||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {string?} error.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
async cancel({reason, code}) {} | ||
} | ||
|
||
class Y { | ||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {Object} error.suberr | ||
* @param {string?} error.suberr.reason the error reason to send the cancellation with | ||
* @param {string?} error.suberr.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
async cancel({reason, suberr}) {} | ||
} | ||
|
||
|
||
//// [file.js] | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
class X { | ||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {string?} error.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
cancel({ reason, code }) { | ||
return __awaiter(this, void 0, void 0, function* () { }); | ||
} | ||
} | ||
class Y { | ||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {Object} error.suberr | ||
* @param {string?} error.suberr.reason the error reason to send the cancellation with | ||
* @param {string?} error.suberr.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
cancel({ reason, suberr }) { | ||
return __awaiter(this, void 0, void 0, function* () { }); | ||
} | ||
} | ||
|
||
|
||
//// [file.d.ts] | ||
declare class X { | ||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {string?} error.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
cancel({ reason, code }: { | ||
reason: string | null; | ||
code: string | null; | ||
}): Promise<any>; | ||
} | ||
declare class Y { | ||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {Object} error.suberr | ||
* @param {string?} error.suberr.reason the error reason to send the cancellation with | ||
* @param {string?} error.suberr.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
cancel({ reason, suberr }: { | ||
reason: string | null; | ||
suberr: { | ||
reason: string | null; | ||
code: string | null; | ||
}; | ||
}): Promise<any>; | ||
} |
35 changes: 35 additions & 0 deletions
35
tests/baselines/reference/jsDeclarationsNestedParams.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,35 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/file.js === | ||
class X { | ||
>X : Symbol(X, Decl(file.js, 0, 0)) | ||
|
||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {string?} error.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
async cancel({reason, code}) {} | ||
>cancel : Symbol(X.cancel, Decl(file.js, 0, 9)) | ||
>reason : Symbol(reason, Decl(file.js, 8, 18)) | ||
>code : Symbol(code, Decl(file.js, 8, 25)) | ||
} | ||
|
||
class Y { | ||
>Y : Symbol(Y, Decl(file.js, 9, 1)) | ||
|
||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {Object} error.suberr | ||
* @param {string?} error.suberr.reason the error reason to send the cancellation with | ||
* @param {string?} error.suberr.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
async cancel({reason, suberr}) {} | ||
>cancel : Symbol(Y.cancel, Decl(file.js, 11, 9)) | ||
>reason : Symbol(reason, Decl(file.js, 21, 18)) | ||
>suberr : Symbol(suberr, Decl(file.js, 21, 25)) | ||
} | ||
|
35 changes: 35 additions & 0 deletions
35
tests/baselines/reference/jsDeclarationsNestedParams.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,35 @@ | ||
=== tests/cases/conformance/jsdoc/declarations/file.js === | ||
class X { | ||
>X : X | ||
|
||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {string?} error.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
async cancel({reason, code}) {} | ||
>cancel : ({ reason, code }: { reason: string | null; code: string | null;}) => Promise<any> | ||
>reason : string | ||
>code : string | ||
} | ||
|
||
class Y { | ||
>Y : Y | ||
|
||
/** | ||
* Cancels the request, sending a cancellation to the other party | ||
* @param {Object} error __auto_generated__ | ||
* @param {string?} error.reason the error reason to send the cancellation with | ||
* @param {Object} error.suberr | ||
* @param {string?} error.suberr.reason the error reason to send the cancellation with | ||
* @param {string?} error.suberr.code the error code to send the cancellation with | ||
* @returns {Promise.<*>} resolves when the event has been sent. | ||
*/ | ||
async cancel({reason, suberr}) {} | ||
>cancel : ({ reason, suberr }: { reason: string | null; suberr: { reason: string | null; code: string | null; };}) => Promise<any> | ||
>reason : string | ||
>suberr : { reason: string; code: string; } | ||
} | ||
|
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
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
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 |
---|---|---|
|
@@ -5,6 +5,6 @@ class C {} | |
|
||
/** @param {C} p */ | ||
function f(p) {} | ||
>f : (p: C) => void | ||
>f : (p: C<any>) => void | ||
>p : C<any> | ||
|
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
Oops, something went wrong.