bem / bem-core

BEM Core Library
https://ru.bem.info/technologies/classic/i-bem/
Other
276 stars 95 forks source link

jsdoc parsing errors with jquery block #1153

Open blond opened 9 years ago

blond commented 9 years ago

Error 1:

Error: "Cannot read property '1' of null" while processing jsdoc comments started at line 35
--------------------------------------------------------------------------------------------
/*!
 * Returns a snapshot of the event, with writable properties.
 *
 * @param {Event} event An event that contains properties to copy.
 * @returns {Object} An object containing shallow copies of `inEvent`'s
 *    properties.
 */
function cloneEvent(event) {
    var eventCopy = $.extend(new $.Event(), event);
    if(event.preventDefault) {
TypeError: Cannot read property '1' of null
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd-plugins-bem/plugins/returns.js:6:63
    at inherit._parseTagComment (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:174:23)
    at inherit._parseJSDocComment (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:162:24)
    at inherit._onIterate (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:117:34)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:97:42
    at Array.forEach (native)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:95:34
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/parser.js:37:21
    at iterateAst (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/ast-iterator.js:7:15)
    at Object.ast.iterate (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/parser.js:33:9)

Error 2:

Error: "Cannot set property 'cons' of undefined" while processing jsdoc comments started at line 83
---------------------------------------------------------------------------------------------------
/*!
 * Pointer event constructor
 *
 * @param {String} type
 * @param {Object} [params]
 * @returns {Event}
 * @constructor
 */
function PointerEvent(type, params) {
    params || (params = {});

TypeError: Cannot set property 'cons' of undefined
    at Object.<anonymous> (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd-plugins-bem/plugins/constructor.js:5:36)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:134:45
    at Array.forEach (native)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:131:49
    at Array.forEach (native)
    at inherit._onIterate (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:119:27)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:97:42
    at Array.forEach (native)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:95:34
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/parser.js:37:21
    at Error (native)
    at inherit.parse (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:109:46)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/node_modules/jsd/lib/jsdoc.js:12:22
    at module.exports (/Users/blond/projects/bem-core/node_modules/enb-bem-docs/node_modules/bem-jsd/lib/bem-jsd.js:34:12)
    at /Users/blond/projects/bem-core/node_modules/enb-bem-docs/lib/techs/jsdoc-json.js:24:36
    at Array.<anonymous> (/Users/blond/projects/bem-core/node_modules/enb/node_modules/vow/lib/vow.js:202:56)
    at Immediate.callFns [as _onImmediate] (/Users/blond/projects/bem-core/node_modules/enb/node_modules/vow/lib/vow.js:462:35)
    at processImmediate [as _immediateCallback] (timers.js:367:17)
qfox commented 9 years ago

Why using /*! ... */? ;-)

veged commented 8 years ago

is it actual?

tadatuta commented 8 years ago

it's still actual

skad0 commented 7 years ago

Error 2: The problem is because in the whole bem-core @constructor used instead of @constructs. Following this docs @constructor is an synonym for @class. And here the docs for @constructs.

I can solve this issue by replacing @constructor with @constructs + at bem/jsd-plugins-bem we should make @constructor plugin as an alias of @class and current solution should be renamed to @constructs.

@tadatuta @dfilatov

qfox commented 7 years ago

Send a PR with changes made with find *.blocks/ -name '*.js' | sed -i '' -e '%@constructor%@constructs %g' -i please!

skad0 commented 7 years ago

Send a PR with changes made with find .blocks/ -name '.js' | sed -i '' -e '%@constructor%@constructs %g' -i please!

I'll check other mistakes and make PR