Skip to content

Commit 7530a2b

Browse files
committed
Merge branch 'master' of github.com:documentationjs/documentation
2 parents 1409aeb + 2c2087d commit 7530a2b

File tree

7 files changed

+1010
-2
lines changed

7 files changed

+1010
-2
lines changed

lib/flow_doctrine.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,13 @@ function flowDoctrine(type/*: Object */)/*: DoctrineType*/ {
9898
return {
9999
type: 'FunctionType',
100100
params: type.params.map(param => {
101+
let name = '';
102+
if (param.name && param.name.name) {
103+
name = param.name.name;
104+
}
101105
return {
102106
type: 'ParameterType',
103-
name: param.name.name,
107+
name,
104108
expression: flowDoctrine(param.typeAnnotation)
105109
};
106110
}),

lib/output/util/format_type.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,10 @@ function formatType(getHref/*: Function*/, node/*: ?Object */) {
118118
case Syntax.NameExpression:
119119
return [link(node.name, getHref)];
120120
case Syntax.ParameterType:
121-
return [t(node.name + ': ')].concat(formatType(getHref, node.expression));
121+
if (node.name) {
122+
result.push(t(node.name + ': '));
123+
}
124+
return result.concat(formatType(getHref, node.expression));
122125

123126
case Syntax.TypeApplication:
124127
return formatType(getHref, node.expression)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// @flow
2+
3+
'use strict';
4+
5+
/** x */
6+
let x: T => string;
7+
8+
/** x2 */
9+
let x2: (a: T) => string;
10+
11+
/** T */
12+
type T = string[] => {num: number};
13+
14+
/** T2 */
15+
type T2 = (a: string[]) => {num: number};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy