Skip to content

Commit 466b21e

Browse files
committed
Cosmetic changes to lob.js and added use strict to util.js
1 parent b8beed1 commit 466b21e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/lob.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Lob.prototype._read = function() {
8787
// Emits 'close' event after closing LOB
8888
self._closeSync();
8989
}
90+
9091
self.emit('error', err);
9192
return;
9293
}
@@ -102,7 +103,6 @@ Lob.prototype._read = function() {
102103
self.emit('error', err);
103104
return;
104105
}
105-
106106
});
107107
}
108108
}
@@ -118,8 +118,10 @@ Lob.prototype._write = function(data, encoding, cb) {
118118
function(err) {
119119
if (err) {
120120
self._closeSync(); // Ignore if any error occurs during close
121-
return cb(err);
121+
cb(err);
122+
return;
122123
}
124+
123125
cb();
124126
}
125127
);
@@ -132,13 +134,14 @@ Lob.prototype._write = function(data, encoding, cb) {
132134
Lob.prototype._closeSync = function() {
133135
var self = this;
134136

135-
if (self.iLob != null) {
137+
if (self.iLob !== null) {
136138
try {
137139
self.iLob.release();
138140
} catch(err) {
139141
self.iLob = null;
140142
return err;
141143
}
144+
142145
self.emit('close');
143146
}
144147
};
@@ -152,13 +155,15 @@ Lob.prototype.close = function(closeCb) {
152155
// Return if LOB already closed to support multiple close() calls should be
153156
// no-op
154157
if (!self.iLob.valid) {
155-
return closeCb(null);
158+
closeCb(null);
159+
return;
156160
}
157161

158162
self.iLob.close(function(err) {
159163
if (!err) {
160164
self.emit('close');
161165
}
166+
162167
closeCb(err);
163168
});
164169
};

lib/util.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
*
1818
*****************************************************************************/
1919

20+
'use strict';
21+
2022
var util = require('util');
2123

2224
var EventEmitter = require('events').EventEmitter;

0 commit comments

Comments
 (0)