[Pkg-javascript-commits] [sockjs-client] 423/434: make `new` optional
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:30 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 bc70bc25cf48f200b3d150d2a9a287fecdc95216
Author: James Halliday <mail at substack.net>
Date: Wed Jun 20 19:42:07 2012 -0700
make `new` optional
---
lib/sockjs.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/lib/sockjs.js b/lib/sockjs.js
index 731ae15..3211fd7 100644
--- a/lib/sockjs.js
+++ b/lib/sockjs.js
@@ -7,6 +7,11 @@
*/
var SockJS = function(url, dep_protocols_whitelist, options) {
+ if (this === window) {
+ // makes `new` optional
+ return new SockJS(url, dep_protocols_whitelist, options);
+ }
+
var that = this, protocols_whitelist;
that._options = {devel: false, debug: false, protocols_whitelist: [],
info: undefined, rtt: undefined};
--
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