Skip to content
This repository was archived by the owner on Nov 28, 2018. It is now read-only.

Commit 365e419

Browse files
committed
Merge pull request #19 from aleafs/master
make sure every variable is defined before use it
2 parents 4184d0d + 7d746b1 commit 365e419

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/stomp.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var net = require('net'),
3131

3232
function parse_command(data) {
3333
var command,
34-
this_string = data.toString('utf8', start=0, end=data.length);
34+
this_string = data.toString('utf8', 0, data.length);
3535
command = this_string.split('\n');
3636
return command[0];
3737
};
@@ -70,9 +70,9 @@ function parse_frame(chunk) {
7070

7171
command = parse_command(chunk);
7272
data = chunk.slice(command.length + 1, chunk.length);
73-
data = data.toString('utf8', start=0, end=data.length);
73+
data = data.toString('utf8', 0, data.length);
7474

75-
the_rest = data.split('\n\n');
75+
var the_rest = data.split('\n\n');
7676
headers = parse_headers(the_rest[0]);
7777
body = the_rest.slice(1, the_rest.length);
7878

@@ -300,7 +300,7 @@ Stomp.prototype.disconnect = function() {
300300
* @param {Object} headers
301301
*/
302302
Stomp.prototype.subscribe = function(headers) {
303-
var self = this;
303+
var self = this,
304304
destination = headers['destination'];
305305
headers['session'] = self.session;
306306
send_command(this, 'SUBSCRIBE', headers);
@@ -313,7 +313,7 @@ Stomp.prototype.subscribe = function(headers) {
313313
* @param {Object} headers
314314
*/
315315
Stomp.prototype.unsubscribe = function(headers) {
316-
var self = this;
316+
var self = this,
317317
destination = headers['destination'];
318318
headers['session'] = self.session;
319319
send_command(this, 'UNSUBSCRIBE', headers);
@@ -370,8 +370,8 @@ Stomp.prototype.abort = function(transaction_id) {
370370
* @return {Object} Frame object of message sent
371371
*/
372372
Stomp.prototype.send = function(headers, want_receipt) {
373-
var self = this;
374-
destination = headers['destination'];
373+
var self = this,
374+
destination = headers['destination'],
375375
body = headers['body'] || null;
376376
delete headers['body'];
377377
headers['session'] = self.session;

0 commit comments

Comments
 (0)