JSDoc should do more to interpret IIFEs
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 15.5k
- Forks
- 1.5k
- Avg merge
- 10d 23h
- Merged PRs (30d)
- 1
Description
JSDoc does not detect functions created by compiling CoffeeScript functions with proper JSDoc comments. Here is a simple example:
x = 1
###*
* Funtion to ...
###
a = () ->
1
x = 1 or some other code had to be before the comment, otherwise CoffeeScript assigns the comment to the file outer anonymous function and not the inner function.
After compilation CoffeeScript generates the following JavaScript code:
// Generated by CoffeeScript 1.6.3
(function() {
var a, x;
x = 1;
/**
* Funtion to ...
*/
a = function() {
return 1;
};
}).call(this);
On this code, JSDoc does not detect the a function.
If the var a, x; line is removed, JSDoc works fine.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the compiled JavaScript example in the issue and trace JSDoc's handling of IIFEs and function detection; no repository file or test is named in the report. Done means the a function is detected when the generated var a, x; declaration remains, with a regression test covering this CoffeeScript output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- coffeescript, javascript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100