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

Bug 326450

Summary: parser error in js files containing only JSON contents
Product: [WebTools] JSDT Reporter: Jim Zhang <jzhang>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: RESOLVED WONTFIX QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: cmjaun
Version: unspecified   
Target Milestone: 3.2.4   
Hardware: All   
OS: All   
Whiteboard:

Description Jim Zhang CLA 2010-09-28 14:43:54 EDT
Build Identifier: WTP 3.2

I should be able to use .js file to define JSON data right?  Basically renaming a .json file to .js, and everything should be exactly the same.  But I get parser errors in .js files.

Reproducible: Always
Comment 1 Chris Jaun CLA 2010-11-09 13:47:51 EST
Bug description needs more information/sample code.
Comment 2 Jim Zhang CLA 2010-11-10 11:13:49 EST
To reproduce, paste the following to a js file:

/**
 * this is my model object
 */
{
	"property1": {
		"subprop1": "value1"
	}
}

You get a red squiggly in the opening brace saying "Syntax error on token {, ...".
Comment 3 Chris Jaun CLA 2011-03-23 10:31:20 EDT
This is not valid JavaScript. The following statement throws an error at runtime.

No plan to support.