JavaScript: what the heck do visitors return?
- Dominant language
- Java
- Stars
- 19k
- Forks
- 3.5k
- PR merge metrics
- No merged PRs in 30d
Description
```
visitParent(ctx) {
console.log(JSON.stringify(
visitChildren()[1][0] ); <--- whoa!
}
visitChild(ctx) {
return new Child('something');
}
```
Now, instead of getting just "Child", visitParent gets Child wrapped in some structure.
To get to the Child object, I have to do something like ```visitChildren()[1][0]```
What's the wrapping stuff? Is [1][0] always correct, to get to the object I actually returned?
Insights greatly appreciated.
Contributor guide
Research direction
The issue names no documentation file, implementation entry point, or test. Start by tracing the JavaScript visitor API and its visitChildren return structure, then document whether the [1][0] access is guaranteed and add or update a focused example or test showing the expected return value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100