Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326450 - parser error in js files containing only JSON contents
Summary: parser error in js files containing only JSON contents
Status: RESOLVED WONTFIX
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.4   Edit
Assignee: Project Inbox CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-28 14:43 EDT by Jim Zhang CLA
Modified: 2011-03-23 10:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.