ECMAScript 7 support

126 views
Skip to first unread message

Александр Митенко

unread,
Feb 27, 2017, 8:39:35 AM2/27/17
to SonarQube
Hi!

Can you tell me the date in mind of the ECMAScript 7 Standard support in the JavaScript plugin?

Thanx, Alexander.

Elena Vilchik

unread,
Feb 27, 2017, 10:48:54 AM2/27/17
to SonarQube
Hello,

Do you mean ECMAScript 2016 standard (https://www.ecma-international.org/ecma-262/7.0/)? We support it since SonarJS 2.12. 
Do you have any parsing problems?

Thanks

Elena 

Александр Митенко

unread,
Feb 28, 2017, 2:27:40 AM2/28/17
to SonarQube
Hello!

Yes, we have parsing problem at bind shortcut:

::this.handleEsc must be equivalent for this.handleEsc.bind(this)

but SonarJS log an exception for :: notation:
[ERROR] Unable to parse file: .... 
[ERROR] Parse error at line .. column ..

Thanx!

Alexander

понедельник, 27 февраля 2017 г., 18:48:54 UTC+3 пользователь Elena Vilchik написал:

Александр Митенко

unread,
Feb 28, 2017, 2:31:39 AM2/28/17
to SonarQube
Hello,

What about info at official page? https://www.sonarsource.com/why-us/products/languages/javascript.html tell us about SonarJS supports ECMAScript 6 / ECMAScript 2015...

BR

Alexander

понедельник, 27 февраля 2017 г., 16:39:35 UTC+3 пользователь Александр Митенко написал:

Elena Vilchik

unread,
Feb 28, 2017, 3:09:58 AM2/28/17
to SonarQube
Hello Alexandr,

It's an experimental feature at stage 0 (see https://github.com/tc39/proposals/blob/master/stage-0-proposals.md "Function Bind Syntax") for version 2017 (aka 8th edition), which is under development currently. Our current strategy is to support features of ES 2017 at state 2 and over.

And thanks for pointing at the wrong doc! we should update it.


Elena.

Александр Митенко

unread,
Feb 28, 2017, 4:39:04 AM2/28/17
to Elena Vilchik, SonarQube
Hello, Elena!

Thank You for correct pointing me to that feature.
Can You advice me, how this point correlates with ECMAScript version roadmap?

Thanks

Alexander

Без вирусов. www.avast.ru

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/EE2NGCjaQgk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/86728a63-5428-45cd-977b-0f49c6c17b21%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
С Уважением,
Александр Митенко.

Elena Vilchik

unread,
Feb 28, 2017, 5:14:48 AM2/28/17
to SonarQube, elena....@sonarsource.com
Our plugin SonarJS fully supports ECMAScript 5, 6 and 7 (aka 2015 and 2016). The next version of ECMAScript (8 or 2017) is under development and we add its features/proposals to SonarJS as soon as they reach stage 2.
The feature you use is at stage 0, so it's absolutely experimental now. Until it reaches stage 2 (which might never happen) we will not support it.

Elena
To unsubscribe from this group and all its topics, send an email to sonarqube+...@googlegroups.com.

marcel...@gmail.com

unread,
Feb 28, 2017, 7:15:46 AM2/28/17
to SonarQube, elena....@sonarsource.com
Hello all,

we have a parsing error related to ECMAScript 6 (Sorry for adding this to a ECMA7 thread, but it seems related to Elena's answer). 

import {Component} from '@angular/core';

/**
 * Class representing a template message.
 */

@Component({
  moduleId
: __moduleName,
 
template: '<h2>template</h2>'
})
export class TemplateComponent {
^
}

This parsing error seems to be related to ECMAScript 6 Decorators. 
Is this fixable? Sadly almost all files contain such a construct.

Thanks in advance,
Marcel

Elena Vilchik

unread,
Feb 28, 2017, 8:29:53 AM2/28/17
to SonarQube, elena....@sonarsource.com, marcel...@gmail.com
Hi Marcel,

In fact decorators are part of ECMA 2017 (aka 8). And indeed, we fail to parse decorators for a class declared inside export statement as this is not mentioned in the proposal specification (http://tc39.github.io/proposal-decorators/#sec-syntax). Do you have a specification for this syntax?

Elena

marcel...@gmail.com

unread,
Mar 1, 2017, 6:47:23 AM3/1/17
to SonarQube, elena....@sonarsource.com, marcel...@gmail.com
Thanks Elena,

I always get the ECMA versions mixed up. I was unsuccessful in finding direct specification. 
We followed the Angular 2 documentation (https://angular.io/docs/ts/latest/guide/ngmodule.html) which is focusing on TypeScript.
There is an ongoing discussion whether to move to TypeScript.

As you mentioned somewhere else in this group there could come official TypeScript support to sonarqube.

Thanks
Marcel
Reply all
Reply to author
Forward
0 new messages