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

src/mermaid.js generates bad code #297

Closed
LarryKlugerDS opened this issue Feb 10, 2016 · 1 comment
Closed

src/mermaid.js generates bad code #297

LarryKlugerDS opened this issue Feb 10, 2016 · 1 comment

Comments

@LarryKlugerDS
Copy link
Contributor

Current version of src/mermaid.js generates bad code (YUI Compressor doesn't accept it) in dist/mermaid.js

Problem:

   nodes = nodes === undefined ? document.querySelectorAll('.mermaid')
        : typeof nodes === 'string' ? document.querySelectorAll(nodes)
        : nodes instanceof Node ? [nodes]
        /*! Last case  - sequence config was passed pick next */
        : nodes;

Solves problem:
   nodes = nodes === undefined ? document.querySelectorAll('.mermaid')
        : typeof nodes === 'string' ? document.querySelectorAll(nodes)
        : nodes instanceof Node ? [nodes]
        : nodes;  // Last case  - sequence config was passed pick next

Pull request is forthcoming

Log:

yuicompressor-2.4.8.jar dist/mermaid.js -o foo
[ERROR] in dist/mermaid.js
  39901:60:missing : in conditional expression
[ERROR] in dist/mermaid.js
  39902:6:syntax error
[ERROR] in dist/mermaid.js
  1:0:Compilation produced 2 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 2 syntax errors.
    at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:172)
    at org.mozilla.javascript.Parser.parse(Parser.java:396)
    at org.mozilla.javascript.Parser.parse(Parser.java:340)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:315)
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:536)
    at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:147)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)
DSA010328:mermaid larry.kluger$ npm run dist
@tylerlong
Copy link
Collaborator

No longer relevant.

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

No branches or pull requests

2 participants