[Pkg-javascript-commits] [sockjs-client] 339/434: Cosmetic: No need to verify window.ActiveXObject - we're already in try/catch block

Tonnerre Lombard tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:23 UTC 2014


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch master
in repository sockjs-client.

commit 3735a6a89c954da5b168166853ceb9fb62a34966
Author: Marek Majkowski <majek04 at gmail.com>
Date:   Wed Feb 1 10:52:08 2012 +0000

    Cosmetic: No need to verify window.ActiveXObject - we're already in try/catch block
---
 lib/dom2.js | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/dom2.js b/lib/dom2.js
index 426ef06..c5a4afe 100644
--- a/lib/dom2.js
+++ b/lib/dom2.js
@@ -7,13 +7,11 @@ XHRObject.prototype = new EventEmitter(['chunk', 'finish']);
 
 XHRObject.prototype._start = function(method, url, payload) {
     var that = this;
-    if (_window.ActiveXObject) {
+    try {
+        that.xhr = new _window.ActiveXObject('Microsoft.XMLHTTP');
         // IE caches POSTs
         url += ((url.indexOf('?') === -1) ? '?' : '&') + 't='+(+new Date);
-        try {
-            that.xhr = new ActiveXObject('Microsoft.XMLHTTP');
-        } catch(x) {};
-    }
+    } catch(x) {};
     if (!that.xhr) {
         that.xhr = new XMLHttpRequest();
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list