micmath/jsdoc — Issue #49: Local var definition and exports in RequireJS module
Author: danrzeppa
Created: 2011-10-14 21:26:09+00:00
State: open

Sometimes in RequireJS modules I define a local variable in the same statement that exports a function. This appears to confuse JSDoc as it does not recognize the exported symbol as being exported.

**File1**

```javascript
/** @exports file1 */
define(function(){
var exports={}

/** @constructor */
var someObject = exports.someObject = function() {}
someObject.prototype.whatever=function() {}

return exports
})
```
JSDoc cannot resolve the reference to `module:file1.someObject` in the `@augments` tag in

**File 2**

```javascript
/** @exports file2 */
define(function(){
var exports = {}
var file1 = require("./file1")

/**
* @constructor
* @augments module:file1.someObject
*/
exports.otherObject = function() {}

return exports
})
```

This is not a critical, or truly breaking issue since the same thing can be accomplished via

```javascript
/** @constructor */
exports.someObject = function() {}
var someObject = exports.someObject
```
But it would be nice if at some point it was supported.