mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Disallow nested object param syntax in callback tag (#24392)
* Callback tag:Disallow nested-object-param syntax Previously this caused a crash in parsing. If/when we want to support this syntax, we will need to fix this crash. * Update baselines
This commit is contained in:
committed by
GitHub
parent
edf667b7e0
commit
e250942d6a
@@ -6707,7 +6707,7 @@ namespace ts {
|
||||
<JSDocParameterTag>createNode(SyntaxKind.JSDocParameterTag, atToken.pos);
|
||||
let comment: string | undefined;
|
||||
if (indent !== undefined) comment = parseTagComments(indent + scanner.getStartPos() - atToken.pos);
|
||||
const nestedTypeLiteral = parseNestedTypeLiteral(typeExpression, name, target);
|
||||
const nestedTypeLiteral = target !== PropertyLikeParse.CallbackParameter && parseNestedTypeLiteral(typeExpression, name, target);
|
||||
if (nestedTypeLiteral) {
|
||||
typeExpression = nestedTypeLiteral;
|
||||
isNameFirst = true;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/jsdoc/namespaced.js ===
|
||||
/**
|
||||
* @callback NS.Nested.Inner
|
||||
* @param {string} space - spaaaaaaaaace
|
||||
* @param {string} peace - peaaaaaaaaace
|
||||
* @param {Object} space - spaaaaaaaaace
|
||||
* @param {Object} peace - peaaaaaaaaace
|
||||
* @return {string | number}
|
||||
*/
|
||||
var x = 1;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
=== tests/cases/conformance/jsdoc/namespaced.js ===
|
||||
/**
|
||||
* @callback NS.Nested.Inner
|
||||
* @param {string} space - spaaaaaaaaace
|
||||
* @param {string} peace - peaaaaaaaaace
|
||||
* @param {Object} space - spaaaaaaaaace
|
||||
* @param {Object} peace - peaaaaaaaaace
|
||||
* @return {string | number}
|
||||
*/
|
||||
var x = 1;
|
||||
@@ -11,9 +11,9 @@ var x = 1;
|
||||
|
||||
/** @type {NS.Nested.Inner} */
|
||||
function f(space, peace) {
|
||||
>f : (space: string, peace: string) => string
|
||||
>space : string
|
||||
>peace : string
|
||||
>f : (space: any, peace: any) => string
|
||||
>space : any
|
||||
>peace : any
|
||||
|
||||
return '1'
|
||||
>'1' : "1"
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
// @Filename: namespaced.js
|
||||
/**
|
||||
* @callback NS.Nested.Inner
|
||||
* @param {string} space - spaaaaaaaaace
|
||||
* @param {string} peace - peaaaaaaaaace
|
||||
* @param {Object} space - spaaaaaaaaace
|
||||
* @param {Object} peace - peaaaaaaaaace
|
||||
* @return {string | number}
|
||||
*/
|
||||
var x = 1;
|
||||
|
||||
Reference in New Issue
Block a user