Test @typedef in @typedef-only JS files

Previously there was nothing for the @typedef to attach to, so the
comment was never parsed. Now these comments attach to the EOF token.
This commit is contained in:
Nathan Shively-Sanders 2017-06-13 10:37:04 -07:00
parent 6d3e15f0ee
commit b967bbb722
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,12 @@
=== tests/cases/conformance/jsdoc/dtsEquivalent.js ===
/** @typedef {{[k: string]: any}} AnyEffect */
No type information for this code./** @typedef {number} Third */
No type information for this code.=== tests/cases/conformance/jsdoc/index.js ===
/** @type {AnyEffect} */
let b;
>b : Symbol(b, Decl(index.js, 1, 3))
/** @type {Third} */
let c;
>c : Symbol(c, Decl(index.js, 3, 3))

View File

@ -0,0 +1,12 @@
=== tests/cases/conformance/jsdoc/dtsEquivalent.js ===
/** @typedef {{[k: string]: any}} AnyEffect */
No type information for this code./** @typedef {number} Third */
No type information for this code.=== tests/cases/conformance/jsdoc/index.js ===
/** @type {AnyEffect} */
let b;
>b : { [k: string]: any; }
/** @type {Third} */
let c;
>c : number

View File

@ -0,0 +1,11 @@
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @Filename: dtsEquivalent.js
/** @typedef {{[k: string]: any}} AnyEffect */
/** @typedef {number} Third */
// @Filename: index.js
/** @type {AnyEffect} */
let b;
/** @type {Third} */
let c;