Skip to content

Commit

Permalink
Merge pull request #4 from plaidev/feature/2-2
Browse files Browse the repository at this point in the history
1.4.x以降のバージョンに対するコードで、キャッシュが存在するかの判定を修正
  • Loading branch information
nashibao authored Jun 29, 2016
2 parents 465914e + 885720f commit 529bdc2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions lib/client.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(function() {
var Client, _managers,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
var Client, _managers;

_managers = {};

Expand All @@ -17,7 +16,7 @@
if (io_or_socket.Manager != null) {
path = '/' + this.name_space;
uri = this.url;
if (!(__indexOf.call(_managers, uri) >= 0)) {
if (!(uri in _managers)) {
_managers[uri] = io_or_socket.Manager(uri, options.connect_options);
}
this._socket = _managers[uri].socket(path);
Expand Down
2 changes: 1 addition & 1 deletion src/client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Client
if io_or_socket.Manager?
path = '/' + @name_space
uri = @url
if not (uri in _managers)
if not (uri of _managers)
_managers[uri] = io_or_socket.Manager(uri, options.connect_options)
@_socket = _managers[uri].socket(path)

Expand Down

0 comments on commit 529bdc2

Please sign in to comment.