Skip to content

fix several exceptions when validating files missing jsdoc tags#37

Closed
boneskull wants to merge 1 commit intojscs-dev:masterfrom
boneskull:master
Closed

fix several exceptions when validating files missing jsdoc tags#37
boneskull wants to merge 1 commit intojscs-dev:masterfrom
boneskull:master

Conversation

@boneskull
Copy link
Copy Markdown
Contributor

Fixes #39

TypeError: Cannot call method 'iterateByType' of null
    at Object.validateCheckParamNames (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc/check-param-names.js:13:16)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:96:27
    at Array.forEach (native)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:95:32
    at Array.forEach (native)
    at Object.JsFile.iterateNodesByType (/Volumes/samara/projects/boneskull/angular-tags/node_modules/grunt-jscs/node_modules/jscs/lib/js-file.js:284:42)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:86:18
    at Array.forEach (native)
    at Object.module.exports.check (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:78:29)
    at null.<anonymous> (/Volumes/samara/projects/boneskull/angular-tags/node_modules/grunt-jscs/node_modules/jscs/lib/string-checker.js:285:26)

TypeError: Cannot call method 'iterateByType' of null
    at Object.validateCheckParamNames (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc/check-redundant-params.js:13:16)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:96:27
    at Array.forEach (native)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:95:32
    at Array.forEach (native)
    at Object.JsFile.iterateNodesByType (/Volumes/samara/projects/boneskull/angular-tags/node_modules/grunt-jscs/node_modules/jscs/lib/js-file.js:284:42)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:86:18
    at Array.forEach (native)
    at Object.module.exports.check (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:78:29)
    at null.<anonymous> (/Volumes/samara/projects/boneskull/angular-tags/node_modules/grunt-jscs/node_modules/jscs/lib/string-checker.js:285:26)

TypeError: Cannot read property 'value' of undefined
    at DocComment.<anonymous> (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc/check-redundant-params.js:22:29)
    at DocComment.<anonymous> (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/jsdoc.js:74:16)
    at Array.forEach (native)
    at DocComment.iterateByTypes [as iterateByType] (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/jsdoc.js:70:19)
    at Object.validateCheckParamNames (/Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc/check-redundant-params.js:14:20)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:96:27
    at Array.forEach (native)
    at /Volumes/samara/projects/boneskull/angular-tags/node_modules/jscs-jsdoc/lib/rules/validate-jsdoc.js:95:32
    at Array.forEach (native)
    at Object.JsFile.iterateNodesByType (/Volumes/samara/projects/boneskull/angular-tags/node_modules/grunt-jscs/node_modules/jscs/lib/js-file.js:284:42)

@qfox
Copy link
Copy Markdown
Member

qfox commented Nov 10, 2014

Thanks for contributing. Can you rewrite this as:

if (!node.jsdoc) {
  return;
}
// the rest

To keep diffs tiny.

Also, if possible, can you add test for this case?

@qfox qfox added the bug label Nov 10, 2014
@qfox
Copy link
Copy Markdown
Member

qfox commented Nov 10, 2014

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.0.17 throws "TypeError: Cannot call method 'iterateByType' of null"

2 participants