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:
Nathan Shively-Sanders
2018-05-24 15:11:33 -07:00
committed by GitHub
parent edf667b7e0
commit e250942d6a
4 changed files with 10 additions and 10 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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"

View File

@@ -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;