documentationjs / documentationjs/documentation

4.0.0-rc.1 @typedef with Symbol.iterator @property fails with "Parent of Symbol.iterator not found"

Open
#837 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.8k
Forks
481
PR merge metrics
No merged PRs in 30d

Description

The [`@typedef`](http://usejsdoc.org/tags-typedef.html) JSDoc allows `@property` definitions with common `Symbol` method names. These worked in 4.0.0-beta4 but started to fail in 4.0.0-rc.1:

Test case which fails:

```
/**
* @typedef {Object} Iterable
* @template T The type of each iterated value
* @property {function (): Iterator} Symbol.iterator
* A method which produces an Iterator for this Iterable.
*/
```

With error:

```
Error: Parent of Symbol.iterator not found
at insertTag (/Users/leebyron/src/iterall/node_modules/documentation/lib/nest.js:71:19)
at _.sortBy.reduce (/Users/leebyron/src/iterall/node_modules/documentation/lib/nest.js:78:7)
```

My guess at a blame rev: 73747306a0ebbab21ed8d6f44e58431928f85032

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.