#4829 closed defect (fixed)
dojo.data tests failing
Reported by: | Adam Peller | Owned by: | Adam Peller |
---|---|---|---|
Priority: | high | Milestone: | 1.0 |
Component: | General | Version: | 0.9 |
Keywords: | Cc: | alex | |
Blocked By: | Blocking: |
Description
perhaps something to do with the new throw if something goes wrong in the xhr json code?
Change History (7)
comment:1 Changed 13 years ago by
comment:2 Changed 13 years ago by
The problem is the regular expression only works if the JSON is all one line. If the JSON is formatted at all, it fails. For example:
Fails: /* { identifier: 'abbr',
items: [
{ abbr:'ec', name:'Ecuador', capital:'Quito' }, { abbr:'eg', name:'Egypt', capital:'Cairo' }, { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, { abbr:'er', name:'Eritrea', capital:'Asmara' }, { abbr:'ee', name:'Estonia', capital:'Tallinn' }, { abbr:'et', name:'Ethiopia', capital:'Addis Ababa' }
]} */
Works: /* { identifier: 'abbr', items: [{ abbr:'ec', name:'Ecuador', capital:'Quito' },{ abbr:'eg', name:'Egypt', capital:'Cairo' },{ abbr:'sv', name:'El Salvador', capital:'San Salvador' },{ abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' },{ abbr:'er', name:'Eritrea', capital:'Asmara' },{ abbr:'ee', name:'Estonia', capital:'Tallinn' },{ abbr:'et', name:'Ethiopia', capital:'Addis Ababa' }]}*/
comment:3 Changed 13 years ago by
Cc: | alex added |
---|
comment:4 Changed 13 years ago by
Owner: | changed from Jared Jurkiewicz to Adam Peller |
---|
comment:5 Changed 13 years ago by
Changeset with minor warning fix: http://trac.dojotoolkit.org/changeset/11055 Silences the emit about json-comment-optional in core tests.
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
The failure is something in the json-comment-optional code. For values:
/* { identifier: 'abbr',
]} */
It claims this isn't comment filtered (it is), then tries to pass it through the normal 'non-comment filtered' json handler.
See: In the handler for json-comment-optional.bootstrap.js (line 416) /* { identifier: 'abbr', items: [ { abbr:'ec', name:'Ecuador', capital:'Quito' }, { abbr:'eg', name:'Egypt', capital:'Cairo' }, { abbr:'sv', name:'El Salvador', capital:'San Salvador' }, { abbr:'gq', name:'Equatorial Guinea', capital:'Malabo' }, { abbr:'er', name:'Eritrea', capital:'Asmara' }, { abbr:'ee', name:'Estonia', capital:'Tallinn' }, { abbr:'et', name:'Ethiopia', capital:'Addis Ababa' } ]} */ bootstrap.js (line 388) In the handler for json-comment-optional. It failed.bootstrap.js (line 421) Error: your JSON wasn't comment filtered! message=your JSON wasn't comment filtered!bootstrap.js (line 422) consider using a mimetype of text/json-comment-filtered to avoid potential security issues with JSON endpoints (use djConfig.usePlainJson=true to turn off this message)bootstrap.js (line 378) SyntaxError?: syntax error message=syntax error
It's something to do with the regexp/change there. Looking further. Looks to be a bug in base Xhr code.