We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 333efcb commit e59820aCopy full SHA for e59820a
src/Doc/FunctionDoc.js
@@ -1,3 +1,4 @@
1
+import babelGenerator from 'babel-generator';
2
import AbstractDoc from './AbstractDoc.js';
3
import ParamParser from '../Parser/ParamParser.js';
4
import NamingUtil from '../Util/NamingUtil.js';
@@ -18,8 +19,9 @@ export default class FunctionDoc extends AbstractDoc {
18
19
20
if (this._node.id) {
21
if (this._node.id.type === 'MemberExpression') {
- // todo: can not reproduce this condition.
22
- // this._value.name = ASTUtil.flattenMemberExpression(this._node.id);
+ // e.g. foo[bar.baz] = function bal(){}
23
+ const expression = babelGenerator(this._node.id).code;
24
+ this._value.name = `[${expression}]`;
25
} else {
26
this._value.name = this._node.id.name;
27
}
0 commit comments