From d30451889b73b0ae799870703c1338cc7b4bfa0a Mon Sep 17 00:00:00 2001 From: Marek Majkowski Date: Wed, 6 Jun 2012 15:06:42 +0100 Subject: [PATCH] #67 - move default options to a separate function --- lib/sockjs.js | 6 +----- lib/utils.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/sockjs.js b/lib/sockjs.js index 03ed86d9..7b506baf 100644 --- a/lib/sockjs.js +++ b/lib/sockjs.js @@ -8,11 +8,7 @@ var SockJS = function(url, dep_protocols_whitelist, options) { var that = this, protocols_whitelist; - that._options = {devel: false, - debug: false, - protocols_whitelist: [], - info: undefined, - rtt: undefined}; + that._options = utils.defaultOptions(); if (options) { utils.objectExtend(that._options, options); } diff --git a/lib/utils.js b/lib/utils.js index 0175944d..b2c7ec23 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -323,3 +323,13 @@ utils.detectProtocols = function(probed, protocols_whitelist, info) { } return protocols; } + +utils.defaultOptions = function(){ + return {devel: false, + debug: false, + protocols_whitelist: [], + info: undefined, + rtt: undefined, + max_window_time: 4000, + init_window_size: 4096}; +}