diff --git a/src/base.js b/src/base.js index 8850f28..391412f 100755 --- a/src/base.js +++ b/src/base.js @@ -501,10 +501,8 @@ var xdescribe = function(description, specDefinitions) { }; -jasmine.XmlHttpRequest = XMLHttpRequest; - // Provide the XMLHttpRequest class for IE 5.x-6.x: -if (typeof XMLHttpRequest == "undefined") jasmine.XmlHttpRequest = function() { +jasmine.XmlHttpRequest = (typeof XMLHttpRequest == "undefined") ? function() { try { return new ActiveXObject("Msxml2.XMLHTTP.6.0"); } catch(e) { @@ -522,7 +520,7 @@ if (typeof XMLHttpRequest == "undefined") jasmine.XmlHttpRequest = function() { } catch(e) { } throw new Error("This browser does not support XMLHttpRequest."); -}; +} : XMLHttpRequest; /** * Adds suite files to an HTML document so that they are executed, thus adding them to the current