Skip to content
New issue

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

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

Already on GitHub? # to your account

Removed offending comma #2612

Merged
merged 1 commit into from
Jun 16, 2020
Merged

Conversation

ehoogerbeets
Copy link
Contributor

This causes a syntax error on node 6 and earlier:

edwin@Lisbon:~/ht/loctool/test$ node -v
v6.17.1
edwin@Lisbon:~/ht/loctool/test$ node
> var hl = require("highlight.js");
/data/root/home/edwin/ht/loctool/node_modules/highlight.js/lib/languages/java.js:89
          ),
          ^

SyntaxError: Unexpected token )

Without the comma:

edwin@Lisbon:~/ht/loctool/test$ node -v
v6.17.1
edwin@Lisbon:~/ht/loctool/test$ node
> var hl = require("highlight.js");
>

Much better! That comma is a trailing comma after the last parameter to the function call. Node 6 and earlier do not like it. Node 7 and beyond just ignores it.

This causes a syntax error on node 6 and earlier.
@joshgoebel
Copy link
Member

Is this really the only one? I feel like I see this all the time.

@joshgoebel joshgoebel merged commit 0656588 into highlightjs:master Jun 16, 2020
@ehoogerbeets ehoogerbeets deleted the fixNode6 branch June 16, 2020 19:45
@ehoogerbeets
Copy link
Contributor Author

It's possibly not the only one there, but it is the only one that prevented highlight.js from even loading in node 6 and earlier! Thanks for merging that. What does the release schedule look like? I have a tool (ilib-js/loctool) that is broken because it depends on this and folks are asking me when the loctool will be fixed...

@joshgoebel
Copy link
Member

I released 10.1.1 to fix.

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

Successfully merging this pull request may close these issues.

2 participants