csnover / js-doc-parse

An experimental library for parsing JavaScript files and extracting inline documentation.
31 stars 7 forks source link

js-doc-parser errors #71

Closed spaceone closed 12 years ago

spaceone commented 12 years ago

Here some thinks which can be fixed either in js-doc-parser and the extensions itself (dgrid, xstyle, put-selector): dgrid/Selection.js line 23 //allowSelectAll: Boolean parser crashes because there is a space missing. your decision to allow space or ignore that line with a comment instead of tracing!

This is an error i don't understand (please give me the reason so that i can fix it for me): Processing module xstyle/shim/transition (146.07M used / 177.29M RSS) Processing module xstyle/xstyle (147.21M used / 177.29M RSS) ERR: xstyle/shim/transition.js:4:36 TypeError: Cannot read property 'value' of undefined at null. (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/callHandler/amd.js:60:32) at lang.extend.match (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/dojo/AdapterRegistry.js:82:21) at Object.readers.CallExpression (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:359:29) at read (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:239:28) at Object.ExpressionStatement (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:28:11) at read (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:239:28) at readStatements (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:38:4) at read (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:231:11) at Object.readers.Program (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:653:4) at read (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:239:28) at Object.env.parse (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:850:3)

and my last one: dgrid/List.js:672 " set() may also be called with a hash of name/value pairs, ex:" produces also a crash... propably because of the ':'

keyRe = /^\s+(\w+):\s(.)$/,

ERR: dgrid/List.js:672:12 TypeError: Cannot read property '1' of null at processComment (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/processor/dojodoc.js:223:63) at Object.generateMetadata (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/processor/dojodoc.js:436:17) at /root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:63:14 at Array.forEach (native) at attachMetadata (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:46:18) at createFunctionValue (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:81:3) at Object.readers.FunctionExpression (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:502:16) at read (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:239:28) at Object.readers.ObjectExpression (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:630:21) at read (/root/sandbox/univention-management-console-frontend-doc/js-doc-parse/lib/esprimaParser.js:239:28)

i fixed it through this: diff --git a/lib/processor/dojodoc.js b/lib/processor/dojodoc.js index 16277fe..f620376 100644 --- a/lib/processor/dojodoc.js +++ b/lib/processor/dojodoc.js @@ -218,7 +218,9 @@ define([ if (line.length && indentRe.exec(line)[0].length === keyIndent && line.length !== keyIndent) { var keyLine = keyRe.exec(line);

csnover commented 12 years ago

The parser is intentionally designed to fail on messy or invalid docblocks. That code needs to be fixed.

wkeese commented 12 years ago

Note the problem with https://github.com/SitePen/dgrid/blob/master/List.js#L732 is the indentation. The second paragraph of the description for set() needs to be indented by another tab.

I don't know what's going on with xstyle/shim/transition.js though.