[JavaScript plugin] ERROR: unable to parse ES6 with new.target

31 views
Skip to first unread message

xflo...@gmail.com

unread,
Jul 28, 2016, 12:39:49 PM7/28/16
to SonarQube
Dear all,

I'm having errors while the Sensor JavaScriptSquidSensor parses some ES6 files. The stack is:

18:28:51.972 INFO  - 738 source files to be analyzed
18:28:59.407 ERROR - Unable to parse file: C:/Users/dario.olivini/Sviluppo/[...]/EmittableEvents/AbstractEmittableEvent.js
18:28:59.407 ERROR - Parse error at line 28 column 16:

18: class AbstractEmittableEvent {
19: 
[...]
27:     constructor(eventName) {
28:         if (new.target === AbstractEmittableEvent) {
                   ^
29:             throw new AbstractConstructorError("AbstractEmittableEvent");
30:         }
31:         checkFunctionParam("string", eventName, {message: "eventName is required and must be a string."});
32: 

Have any of you encountered the same problem?
Am I missing something?

However, the analysis has been completed successfully then it is just a warning, it is not an urgent problem, just a warning.

Thank you and good evening

Dario

G. Ann Campbell

unread,
Jul 28, 2016, 1:31:21 PM7/28/16
to SonarQube
Hi Dario,

You know that "new" is a reserved word, right?


Ann

Pierre-Yves Nicolas

unread,
Jul 29, 2016, 3:03:25 AM7/29/16
to xflo...@gmail.com, SonarQube
Hi Dario,

This is indeed a problem.

Thanks a lot for your feedback!

Pierre-Yves

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/4e24d641-75f1-41ad-843b-db7da8e762e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages