#57 ✓invalid
Thomas

JSON - response string evaluation

Reported by Thomas | April 27th, 2008 @ 01:38 PM

you have got a minor issue at line 499(in my dreamweaver),

which looks like this:

evalJSON: function(sanitize) {

var json = this.unfilterJSON();

try {

if (!sanitize || json.isJSON()) return eval('(' + json + ')');

} catch (e) { }

throw new SyntaxError('Badly formed JSON string: ' + this.inspect());

},

As you can see ... >> throw new Syntax Error(arg) << SyntaxError is never defined anywhere else, so I personally think this is not supposed to work propably, is it? I often wondered why a bad JSON Response is not treated anyway, and thus I had to test it on my own - so this might be the reason. Generally it is treated but the actual error will never come to the surface!? There has to be a class like var SyntaxError = Class.create() to call such a thing... am I wrong ?

regards Thomas

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Pages