[jbosstools-issues] [JBoss JIRA] (JBIDE-18138) Javascript errors when importing Aerogear Quickstarts

Victor Rubezhny (JIRA) issues at jboss.org
Thu Sep 11 02:29:19 EDT 2014


    [ https://issues.jboss.org/browse/JBIDE-18138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001137#comment-13001137 ] 

Victor Rubezhny commented on JBIDE-18138:
-----------------------------------------

Related issue: [\[Bug 223131\] \[language support\] Add ecmascript4 /JavaScript 2 compiler compliance level|https://bugs.eclipse.org/bugs/show_bug.cgi?id=223131]

The problem is that ECMA3 that is currently supported by the JSDT Parser doesn't allow to use keywords (like abstract, continue, delete, import and so on) as an identifier (a name of property, function or variable). When the parser faces a keyword that is used as an identifier it reports syntax error and goes into an error recovery mode. And in this case it actually cannot find a solution for such a problem, so usually more errors (like 'semicolon is missing' or 'lvalue should be used' and so on) may appear because the parser cannot restore its flow so it cannot process the rest of the statement (of an expression, for example).

The parser's code (o.e.wst.jsdt.internal.compiler.parser.Parser) is generated from gramma, so the right solution here is to fix the gramma for JavaScript in order to support (complete or or partial) of ECMA5 that allows to use keywords as some identifiers (for sure it is true for property and function names).
But this requires a tonn of work including the whole redesign of parser, compilers, inferrence engines and so on. 

These errors (like 'Syntax error on token 'xxx'. StringLiteral expected') are fatal and generated by the Diagnose parser (o.e.wst.jsdt.internal.compiler.parser.diagnose.DiagnoseParser) and reported as error codes. This error code is translated by the Problem Reporter (o.e.wst.jsdt.internal.compiler.problem.ProblemReporter) into the severity and message.

 Probably we can control the severity of the problem and make it Ignore instead of Error or even skip reporting of syntax error in case of keyword is used, but there still be the following problems reported (like required semicolons or leftvalues and so on) and we cannot control their appearance. Of cource this will not prevent the parser of fail to process the code.

> Javascript errors when importing Aerogear Quickstarts
> -----------------------------------------------------
>
>                 Key: JBIDE-18138
>                 URL: https://issues.jboss.org/browse/JBIDE-18138
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: aerogear-hybrid, jsp/jsf/xml/html source editing
>            Reporter: Burr Sutter
>            Assignee: Victor Rubezhny
>            Priority: Critical
>             Fix For: 4.2.0.CR1
>
>         Attachments: error screenshot on CR1.png
>
>
> Testing of:
> https://github.com/aerogear/aerogear-push-quickstarts/tree/master/client/contacts-mobile-cordova/jqm
> https://github.com/aerogear/aerogear-push-quickstarts/tree/master/client/contacts-mobile-cordova/angular
> Errors:
> http://screencast.com/t/hnI0WZFpxz
> http://screencast.com/t/fGiVBQdm



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jbosstools-issues mailing list