This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 152545 - token FUNCTION in JSON code not recognized
Summary: token FUNCTION in JSON code not recognized
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: JSON (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks: 152546
  Show dependency tree
 
Reported: 2008-11-06 14:55 UTC by koppor
Modified: 2014-10-06 13:06 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description koppor 2008-11-06 14:55:27 UTC
I'm trying to edit following (valid) JSON-File:
http://code.google.com/p/oryx-editor/source/browse/trunk/editor/data/stencilsets/bpel/bpel.json

It includes following code:

"layout":function(shape) {		
  var raiseEvent = shape._delegateEvent.bind(shape);
  raiseEvent({type:'layout.rows',shape:shape,marginTop:30,marginLeft:30,spacingX:30,spacingY:30});	
},

An error "Invalid JSON: unexpected token FUNCTION" is shown.

However, the json works perfectly in Firefox.

Is it possible to add support for the function token?

The code also makes use of "undefined" (which is undefined :)).
At this element, the error "Invalid JSON: unexpected token NAME" is shown. I think, this behavior valid.
Comment 1 musicalshore 2011-12-13 19:17:53 UTC
I'm getting the same problem with very simple JSON files. Below is my JSON:

{
    success: true,
    users: [
        {id: 1, name: 'Ed',    email: 'ed@sencha.com'},
        {id: 2, name: 'Tommy', email: 'tommy@sencha.com'}
    ]
}



I get 'unexpected token NAME' complaints.