prototype: Avoid the try..catch block in Ajax.Response#_getResponseJSON unless required.
This commit is contained in:
parent
0100aee1a0
commit
f870fba94f
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Avoid the try..catch block in Ajax.Response#_getResponseJSON unless required. [Tobie Langel]
|
||||
|
||||
* Add more tests to Element.update. Closes #9327. [Tobie Langel]
|
||||
|
||||
* Make the Ajax.Response#headerJSON property correctly decode unicode characters. Closes #9285. [Marius Feraru, Tobie Langel]
|
||||
|
|
|
@ -287,11 +287,11 @@ Ajax.Response = Class.create({
|
|||
|
||||
_getResponseJSON: function() {
|
||||
var options = this.request.options;
|
||||
if (!options.evalJSON || (options.evalJSON != 'force' &&
|
||||
!(this.getHeader('Content-type') || '').include('application/json')))
|
||||
return null;
|
||||
try {
|
||||
if (options.evalJSON == 'force' || (options.evalJSON &&
|
||||
(this.getHeader('Content-type') || '').include('application/json')))
|
||||
return this.transport.responseText.evalJSON(options.sanitizeJSON);
|
||||
return null;
|
||||
return this.transport.responseText.evalJSON(options.sanitizeJSON);
|
||||
} catch (e) {
|
||||
this.request.dispatchException(e);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue