Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@param parser fails when braces appear in description. #185

Closed
rhys-vdw opened this issue Nov 27, 2015 · 3 comments
Closed

@param parser fails when braces appear in description. #185

rhys-vdw opened this issue Nov 27, 2015 · 3 comments

Comments

@rhys-vdw
Copy link

Just trying out esdoc for the first time. I'm getting errors everywhere I'm using unions in parens. This is supported syntax according to docs.

   * @param {?(Object|function)} initializer
   *  An initializer callback, taking the Options instance as its first
   *  argument. Alternatively an object of {[method]: argument} pairs to be
   *  invoked.
/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/ClassDocBuilder.js:79
            throw _iteratorError;
                  ^
SyntaxError: Invalid regular expression: /[~]\function)} initializer
 An initializer callback, taking the Options instance as its first
 argument. Alternatively an object of {[method]: argument$/: Unmatched ')'
    at RegExp (native)
    at new RegExp (/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/node_modules/core-js/modules/es6.regexp.js:22:76)
    at ClassDocBuilder._findByName (/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:140:20)
    at ClassDocBuilder._buildDocLinkHTML (/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1032:22)
    at ClassDocBuilder._buildTypeDocLinkHTML (/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1008:21)
    at ClassDocBuilder._buildSignatureHTML (/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:1141:33)
    at /Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:500:38
    at IceCap.loop (/Users/rhys/Projects/atlas/data-mapper/node_modules/ice-cap/out/src/IceCap.js:319:15)
    at ClassDocBuilder._buildSummaryDoc (/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:497:11)
    at ClassDocBuilder._buildSummaryHTML (/Users/rhys/Projects/atlas/data-mapper/node_modules/esdoc/out/src/Publisher/Builder/DocBuilder.js:456:29)
npm ls | grep esdoc
├─┬ esdoc@0.4.3
├─┬ esdoc-es7-plugin@0.0.3
@rhys-vdw
Copy link
Author

Seems this was caused by having "{ ... }" in the description. If I wrap it in backticks it works as intended.

   * @param {?(Object|function)} initializer
   *   An initializer callback, taking the Options instance as its first
   *   argument. Alternatively an object of `{[method]: argument}` pairs to be
   *   invoked.

@rhys-vdw rhys-vdw changed the title Nullable union fails @param parser fails when braces appear in description. Nov 27, 2015
h13i32maru added a commit that referenced this issue Feb 11, 2016
@h13i32maru
Copy link
Member

Thanks for reporting this issue. I fixed this issue on master.

@h13i32maru
Copy link
Member

I released v0.4.5 that fixed this issue.

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

No branches or pull requests

2 participants