Skip to main content



      Home
Home » Eclipse Projects » Eclipse Wild Web Developer » Javascript errors reported(How to resolve javascript missing comma error.)
Javascript errors reported [message #1867095] Fri, 14 June 2024 10:00 Go to next message
Eclipse UserFriend
Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)

Version: 2024-06 (4.32.0)
Build id: 20240606-1231

The following code within Eclipse reports multple errors including "semicolon expected". However the same code when validated using https://www.commontools.org/tool/javascript-validator-79
reports no problems.

If there some way I can determine the nature of the problem so that I can resolve these errors in Eclipse.
/*jshint esversion: 6 */
/*jshint esversion: 8 */
	
	function getContextPath() {
	   let result = window.location.pathname.substring(0, window.location.pathname.indexOf("/",2));
	   return result;
	}

	async function newResult(trayID,sampleID,userID,testID,resultID) {
	
		const dataObject = { 
			trayID: trayID,
			sampleID: sampleID,
			userID: userID,
			testID: testID,
			value: resultID
		};
	
		console.log(JSON.stringify(dataObject));
	
		let response = await fetch(getContextPath()+"/TrayResults", { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(dataObject) })
			.then((response) => {
				if (!response.ok) {
					throw new Error(`HTTP error, status = ${response.status}`);
				}
				return response.json();
			})
			.then((data) => {
				/*for (const panel of data) {*/
				console.log("Returned  value trayID=" + data.trayID + " sampleID="+data.sampleID);
				/*}*/
			})
			.catch((error) => {
				console.log("Error " + error);
			});
	
		console.log(response);
	
	}
	



Re: Javascript errors reported [message #1869333 is a reply to message #1867095] Mon, 12 August 2024 13:29 Go to previous messageGo to next message
Eclipse UserFriend
Same issue here. I don't want to disable JS validation entirely, but 2 additional tools also say the source is fine (JSLint and JSHint)
Re: Javascript errors reported [message #1869339 is a reply to message #1869333] Mon, 12 August 2024 15:38 Go to previous message
Eclipse UserFriend
In the end I decided to try the commercial MyEclipse project and it does seem to clean up many of the minor niggles in the basic open source Eclipse
Goto Forum:
  


Current Time: Tue Sep 23 16:52:04 EDT 2025

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

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

Back to the top