[Pkg-javascript-commits] [sockjs-client] 165/434: Fix #13. Automatically convert data to string.
Tonnerre Lombard
tonnerre-guest at moszumanska.debian.org
Wed Jan 8 00:47:11 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 21565848ddade1e5e4e223d1cfc4e38e5b95dc52
Author: Marek Majkowski <majek04 at gmail.com>
Date: Wed Oct 12 13:07:51 2011 +0100
Fix #13. Automatically convert data to string.
---
lib/sockjs.js | 2 +-
tests/html/src/tests.coffee | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/sockjs.js b/lib/sockjs.js
index 1f33fa5..8e1a292 100644
--- a/lib/sockjs.js
+++ b/lib/sockjs.js
@@ -189,7 +189,7 @@ SockJS.prototype.send = function(data) {
if (that.readyState === SockJS.CONNECTING)
throw new Error('INVALID_STATE_ERR');
if (that.readyState === SockJS.OPEN) {
- that._transport.doSend(JSON.stringify(data));
+ that._transport.doSend(JSON.stringify('' + data));
}
return true;
};
diff --git a/tests/html/src/tests.coffee b/tests/html/src/tests.coffee
index 3c791ab..5e1ded0 100644
--- a/tests/html/src/tests.coffee
+++ b/tests/html/src/tests.coffee
@@ -21,7 +21,7 @@ echo_factory_factory = (protocol, messages) ->
r.send(a[0])
r.onmessage = (e) ->
#log('onmessage ' + e);
- deepEqual(e.data, a[0])
+ equal(e.data, '' + a[0])
a.shift()
if typeof a[0] is 'undefined'
r.close()
@@ -39,7 +39,7 @@ factor_echo_basic = (protocol) ->
return echo_factory_factory(protocol, messages)
factor_echo_rich = (protocol) ->
- messages = [ [1,2,3,'data'], null, "data", 1, 12.0, {a:1, b:2} ]
+ messages = [ [1,2,3,'data'], null, false, "data", 1, 12.0, {a:1, b:2} ]
return echo_factory_factory(protocol, messages)
--
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