Comments (14)
Same here. Ran it on two files, undefined reference bomb outs on both...
dox --debug < app.js
/usr/local/lib/node_modules/dox/lib/dox.js:44
comment.code = code = buf.trim();
^
TypeError: Cannot set property 'code' of undefined
at Object.parseComments (/usr/local/lib/node_modules/dox/lib/dox.js:44:22)
at [object Object]. (/usr/local/lib/node_modules/dox/bin/dox:40:17)
at [object Object].emit (events.js:61:17)
at afterRead (fs.js:878:12)
at wrapper (fs.js:245:17)
dox --debug < app-cluster.js
/usr/local/lib/node_modules/dox/lib/dox.js:70
comment.code = code;
^
TypeError: Cannot set property 'code' of undefined
at Object.parseComments (/usr/local/lib/node_modules/dox/lib/dox.js:70:18)
at [object Object]. (/usr/local/lib/node_modules/dox/bin/dox:40:17)
at [object Object].emit (events.js:61:17)
at afterRead (fs.js:878:12)
at wrapper (fs.js:245:17)
from dox.
I'm getting the same error but with version 0.1.1
from dox.
keep in mind the latest dox is a lot different, it's just a json representation of your docs now
from dox.
oh yeah totally, the same error is still occurring though
from dox.
here is an sample:
agreco:src agreco$ dox < env.js > env.json
/Users/agreco/local/node/lib/node_modules/dox/lib/dox.js:44
comment.code = code = buf.trim();
^
TypeError: Cannot set property 'code' of undefined
at Object.parseComments (/Users/agreco/local/node/lib/node_modules/dox/lib/dox.js:44:22)
at [object Object]. (/Users/agreco/local/node/lib/node_modules/dox/bin/dox:40:17)
at [object Object].emit (events.js:61:17)
at afterRead (fs.js:878:12)
at wrapper (fs.js:245:17)
I'm using node 0.4.12 for context
from dox.
ah, ok cool, i'll have to get more test-cases and fix any formatting im not covering
from dox.
ideally we'd use a "proper" javascript parser and just pluck out the comments etc, it's a nice hack currently
from dox.
cool cool, cheers mate
from dox.
This error happens when there's a JavaScript snippet without a comment block before it.
from dox.
Following code illustrate this bug :
// Copyright stuff
/**
* My Comment
*/
I suggest not to take into account the buffer in this case :
dox.js :
if (buf.trim().length) {
comment = comments[comments.length - 1];
if(comment) {
comment.code = code = buf.trim();
comment.ctx = exports.parseCodeContext(code);
}
buf = '';
}
See https://github.com/nopnop/dox
from dox.
Wow. Misclick on my part there.
from dox.
This Issue is still exisiting, Merged fix isn't in current branch.
See https://github.com/visionmedia/dox/blob/master/lib/dox.js
from dox.
dox does now take the reasonable default of not including any code before the first comment, not sure if it's ideal, but probably good enough to close the issue? Or do we want the same behaviour as for a completely blank file, i.e. output a comment with no content to the comment and just the code + context?
from dox.
Seems to be outdated.
from dox.
Related Issues (20)
- Class properties support HOT 1
- Extra whitespace when a tag is followed by an empty line HOT 5
- fileOverview/file/overview HOT 12
- Support more tags HOT 2
- Wrong parsing of param tags with line breaks
- Wrong parsing of default values
- Opt out of parsing typesDescription?
- `*` type ignored HOT 2
- Wrong parsing result when no type is given
- Override detected code with jsdoc directives? HOT 3
- [improvement] Handle @return description the same as @param description. HOT 2
- [improvement] better description handling, and theming idea HOT 6
- Handling ES-2015 exports
- Add support for ES2016 template literals HOT 2
- not parsing {@link} tag HOT 6
- Bump verision no HOT 4
- How to run this on any file (.cpp, .java, etc) HOT 1
- Parsing fails with no indication of which file is broken HOT 2
- Security vulnerabilities with jsdoctypeparser and lodash HOT 1
- dox does not support `async function` from ES2017 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dox.