0

I run the following command:

node_modules/.bin/jsdoc -r --destination /home/user/public_html/jsdoc-meta/ node_modules/jsdoc/

and this is what I get. I don't find the error in the regular expression:

/home/user/node_modules/jsdoc/lib/jsdoc/name.js:77
    var regexp = new RegExp('^' + memberof.toString() + REGEXP_SCOPE_PUNC);
                 ^
SyntaxError: Invalid regular expression: /^harmonyTestFixture.ES6 Template Strings.`\u{000042}\u0042\x42\u0\102\A`[~,#,.]/: Unterminated character class
    at new RegExp (<anonymous>)
    at nameIsLongname (/home/user/node_modules/jsdoc/lib/jsdoc/name.js:77:18)
    at Object.exports.resolve (/home/user/node_modules/jsdoc/lib/jsdoc/name.js:114:21)
    at Doclet.postProcess (/home/user/node_modules/jsdoc/lib/jsdoc/doclet.js:171:20)
    at newSymbolDoclet (/home/user/node_modules/jsdoc/lib/jsdoc/src/handlers.js:190:23)
    at null.<anonymous> (/home/user/node_modules/jsdoc/lib/jsdoc/src/handlers.js:226:29)
    at EventEmitter.emit (events.js:98:17)
    at Visitor.visitNode (/home/user/node_modules/jsdoc/lib/jsdoc/src/visitor.js:283:16)
    at Visitor.visit (/home/user/node_modules/jsdoc/lib/jsdoc/src/visitor.js:177:27)
    at Walker.recurse (/home/user/node_modules/jsdoc/lib/jsdoc/src/walker.js:533:27)
Andras Gyomrey
  • 1,552
  • 11
  • 33

1 Answers1

1

Node (or V8 much rather) tries to parse this as a UTF8 escape sequence:

/^harmonyTestFixture.ES6 Template Strings.`\u{000042}\u0042\x42\u0\102\A`[~,#,.]/
                                                                ^^^^^^

However, due to the backslash between the \u0 and the 102 there's missing characters, thus the error message (Unterminated character class). Depending on what you're trying to achieve, you could either remove that backslash:

/^harmonyTestFixture.ES6 Template Strings.`\u{000042}\u0042\x42\u0102\A`[~,#,.]/
                                                                  ^

or escape the backslash:

/^harmonyTestFixture.ES6 Template Strings.`\u\{000042\}\u0042\x42\u0\\102\A`[~,#,.]/
                                                                    ^^
Fabian Lauer
  • 5,893
  • 3
  • 20
  • 31