Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 326842

Summary: [validation] Use of javascript const gives "missing semicolon" in associative arrays
Product: [WebTools] JSDT Reporter: Daniel Skovenborg <waldeinburg>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: NEW --- QA Contact: Chris Jaun <cmjaun>
Severity: normal    
Priority: P3 CC: cmjaun, earlyster, joaovrb, linzuxiong1988, paul.beusterien
Version: unspecified   
Target Milestone: Future   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Daniel Skovenborg CLA 2010-10-02 09:18:00 EDT
Build Identifier: 20100218-1602

If a javascript file declares a const and an associative array is declared inside a function that declares a local variable, the javascript validator gives a "missing semicolon" warning on the associative array.

Reproducible: Always

Steps to Reproduce:
1. Create a javascript source file with the following code:
const c = 0;

function f() {
	var v;
	a = {
		k: 0
	};
}
2. The validator now gives a "missing semicolon" warning on the "k: 0" line.
Comment 1 Lin ZuXiong CLA 2012-02-06 00:30:21 EST
One way to ignore the annoying errors is that :
1.remove javascript -> validator -> errors/warning.
2.remove project -> .project file -> javascript command
3.It is important,too! delete js file and import again.
Comment 2 Justin Early CLA 2013-01-30 12:04:27 EST
I am not able to reproduce this error with VJET JS IDE[1]

[1] http://eclipse.org/vjet