Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Eclipse Web Tools Platform Project (WTP) » How do I change the javascript version
How do I change the javascript version [message #1840872] Tue, 27 April 2021 16:58 Go to next message
Brian Ray is currently offline Brian RayFriend
Messages: 2
Registered: April 2021
Junior Member
The image shows I have some lines like
var com = com ?? {};
com.kable = com.kable ?? {};
com.kable.web = com.kable.web ?? {};

I have "JavaScript Problems" on these lines "Multiple markers at this line - primary expression expected -':' expected"

But from what I know, this is valid code and shouldn't be generating errors. It executes well when I deploy it and run it. So I am thinking that it is the javascript version in eclipse that is flagging these. I can't figure out how to change the javascript version. When I pull up the Project->Properties->Project Facets, I see JavaScript is at version 1. When I right click on it, I can unlock it but I can't change the version, even if I unlock it.
Re: How do I change the javascript version [message #1842075 is a reply to message #1840872] Tue, 08 June 2021 13:32 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

Which release of Eclipse is this? Are these shown only in the editor, or also in the Problems/Markers Views? If
they're also in the view, what Type are they?


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: How do I change the javascript version [message #1842079 is a reply to message #1840872] Tue, 08 June 2021 16:26 Go to previous messageGo to next message
Brian Ray is currently offline Brian RayFriend
Messages: 2
Registered: April 2021
Junior Member
Version: 2021-03 (4.19.0)
Build id: 20210312-0638

Some of these are shown only in the editor panel, others are shown in the markers view. In the Markers view they are showing up as type "JavaScript" problem.

Here is the shortest file I have that shows the problem.
01 var com = com ?? {};
02 com.kable = com.kable ?? {};
03 com.kable.web = com.kable.web ?? {};
04 com.kable.web.hub = com.kable.web.hub ?? {};
05 
06 com.kable.web.hub.resize = com.kable.web.hub.resize ?? {};
07 
08 function openModal(modalIdNoHash) {
09 	$(`#${modalIdNoHash}`).addClass("active");
10 	        $("#overlay").addClass("active");
11 }
12 
13 function closeModal(modalIdNoHash) {
14 	        $(`#${modalIdNoHash}`).removeClass("active");
15  	$("#overlay").removeClass("active");
16 }
17 
18 


The editor pane has the following markers
01 Multiple markers at this line
- ':' expected
- primary expression expected
02 Multiple markers at this line
- ':' expected
- primary expression expected
03 Multiple markers at this line
- ':' expected
- primary expression expected
05 Multiple markers at this line
- primary expression expected
- ':' expected
08 ',' expected
13 Multiple markers at this line
- Unterminated template literal
- ',' expected
17 Multiple markers at this line
- ',' expected
- '}' expected
- ')' expected

The Markers view has the following
Description Resource Path Location Type
',' expected hub.js /hub/src/main/webapp/resources/js line 8 JavaScript Problem
',' expected hub.js /hub/src/main/webapp/resources/js line 13 JavaScript Problem
',' expected hub.js /hub/src/main/webapp/resources/js line 13 JavaScript Problem
',' expected hub.js /hub/src/main/webapp/resources/js line 13 JavaScript Problem
',' expected hub.js /hub/src/main/webapp/resources/js line 17 JavaScript Problem
Re: How do I change the javascript version [message #1842088 is a reply to message #1842079] Tue, 08 June 2021 18:38 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

You should go to the Validation preference page and turn off the standalone JavaScript Validation
option. Afterward, you can delete any of the messages in the Problems view and they shouldn't
come back.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Can I Create A Browser Based Form From A JSON Schema Like I Can From A WSDL?
Next Topic:Autoformat breaks CSS variables
Goto Forum:
  


Current Time: Sat Apr 20 03:08:02 GMT 2024

Powered by FUDForum. Page generated in 0.03183 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top