mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
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:
parent
6d3e15f0ee
commit
b967bbb722
12
tests/baselines/reference/jsdocTypeDefAtStartOfFile.symbols
Normal file
12
tests/baselines/reference/jsdocTypeDefAtStartOfFile.symbols
Normal 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))
|
||||
|
||||
12
tests/baselines/reference/jsdocTypeDefAtStartOfFile.types
Normal file
12
tests/baselines/reference/jsdocTypeDefAtStartOfFile.types
Normal 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
|
||||
|
||||
11
tests/cases/conformance/jsdoc/jsdocTypeDefAtStartOfFile.ts
Normal file
11
tests/cases/conformance/jsdoc/jsdocTypeDefAtStartOfFile.ts
Normal 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;
|
||||
Loading…
x
Reference in New Issue
Block a user