browserbox
Advanced tools
Comparing version 0.3.11 to 0.3.12
{ | ||
"name": "browserbox", | ||
"version": "0.3.11", | ||
"version": "0.3.12", | ||
"homepage": "https://github.com/whiteout-io/browserbox", | ||
@@ -5,0 +5,0 @@ "description": "IMAP client for browsers.", |
@@ -209,3 +209,6 @@ // Copyright (c) 2014 Andris Reinman | ||
// allows certificate handling for platform w/o native tls support | ||
this.socket.oncert = this.oncert; | ||
// oncert is non standard so setting it might throw if the socket object is immutable | ||
try { | ||
this.socket.oncert = this.oncert; | ||
} catch (E) {} | ||
@@ -212,0 +215,0 @@ this.socket.onerror = this._onError.bind(this); |
@@ -53,2 +53,20 @@ 'use strict'; | ||
describe('#connect', function() { | ||
it('should not throw', function() { | ||
var client = new ImapClient(host, port); | ||
client._TCPSocket = { | ||
open: function() { | ||
var socket = { | ||
onopen: function() {}, | ||
onerror: function() {} | ||
}; | ||
// disallow setting new properties (eg. oncert) | ||
Object.preventExtensions(socket); | ||
return socket; | ||
} | ||
}; | ||
client.connect(); | ||
}); | ||
}); | ||
describe('#close', function() { | ||
@@ -55,0 +73,0 @@ it('should call socket.close', function() { |
348997
8114