Check EOF token to get errors for JSDoc (#28000)

* Check EOF token to get errors for JSDoc

* outputFile instead of noEmit for test
This commit is contained in:
Nathan Shively-Sanders 2018-10-19 16:23:34 -07:00 committed by GitHub
parent 69b1cb5bac
commit bf393ae1cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 41 additions and 0 deletions

View File

@ -27305,6 +27305,7 @@ namespace ts {
clear(potentialNewTargetCollisions);
forEach(node.statements, checkSourceElement);
checkSourceElement(node.endOfFileToken);
checkDeferredNodes(node);

View File

@ -0,0 +1,10 @@
tests/cases/conformance/jsdoc/eof.js(2,20): error TS2304: Cannot find name 'bad'.
==== tests/cases/conformance/jsdoc/eof.js (1 errors) ====
/**
* @typedef {Array<bad>} Should have error here
~~~
!!! error TS2304: Cannot find name 'bad'.
*/

View File

@ -0,0 +1,10 @@
//// [eof.js]
/**
* @typedef {Array<bad>} Should have error here
*/
//// [output.js]
/**
* @typedef {Array<bad>} Should have error here
*/

View File

@ -0,0 +1,6 @@
=== tests/cases/conformance/jsdoc/eof.js ===
/**
No type information for this code. * @typedef {Array<bad>} Should have error here
No type information for this code. */
No type information for this code.
No type information for this code.

View File

@ -0,0 +1,6 @@
=== tests/cases/conformance/jsdoc/eof.js ===
/**
No type information for this code. * @typedef {Array<bad>} Should have error here
No type information for this code. */
No type information for this code.
No type information for this code.

View File

@ -0,0 +1,8 @@
// @outFile: output.js
// @allowJs: true
// @checkJs: true
// @Filename: eof.js
/**
* @typedef {Array<bad>} Should have error here
*/