You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I did some digging and it turns out the problem lies in lib/infer/membership.js, where extractIdentifiers will only resolve membership chains like a.b.c, but not membership chains like this.a.
Changing path.traverse to also watch out for the ThisExpression fixed it for my use case.
path.traverse({ThisExpression : function(path){if(n.isClassMethod(path.scope.block)){identifiers.push(path.scope.path.parentPath.parentPath.node.id.name,'prototype');}},/** * Add an identifier in a path to the identifiers array * @param {Object} path ast path * @returns {undefined} has side-effects * @private */Identifier: function(path){identifiers.push(path.node.name);}});
This is obviously not exhaustive. I am at a loss if this is even the place where this should be handled and if it is, which way forward would be optimal within the given architectural framework.
Since this is not covered at all right now, I am also wondering what should be the minimal requirements for a membership inference with this.
First thanks to everybody working on this. This has great potential to become the very best javascript documentation generator out there.
When I define properties on this inside the constructor of a class, they get documented a properties of the global object.
Removing
@memberof
does not change anything, the new property is still documented as belonging to the global scope.The text was updated successfully, but these errors were encountered: