Skip to content

Commit 9ea2d1e

Browse files
committed
Consistently use return for async callbacks
1 parent b698afd commit 9ea2d1e

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

examples/date.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ var doselect = function(conn, cb) {
127127
d.setDate(d.getDate() - 5);
128128
console.log(d);
129129

130-
cb(null, conn);
130+
return cb(null, conn);
131131
});
132132
};
133133

examples/lobbinds.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ var query_plsql_inout = function (conn, cb) {
202202
function(err)
203203
{
204204
// console.log("clob2.on 'error' event");
205-
cb(err);
205+
return cb(err);
206206
});
207207
clob2.on(
208208
'end',
@@ -226,7 +226,7 @@ var query_plsql_inout = function (conn, cb) {
226226
function(err)
227227
{
228228
// console.log("outStream.on 'error' event");
229-
cb(err);
229+
return cb(err);
230230
});
231231

232232
// Switch into flowing mode and push the LOB to the file
@@ -279,7 +279,7 @@ var plsql_out_inout = function (conn, cb) {
279279
function(err)
280280
{
281281
// console.log("clob2.on 'error' event");
282-
cb(err);
282+
return cb(err);
283283
});
284284
clob2.on(
285285
'end',
@@ -302,7 +302,7 @@ var plsql_out_inout = function (conn, cb) {
302302
function(err)
303303
{
304304
// console.log("outStream.on 'error' event");
305-
cb(err);
305+
return cb(err);
306306
});
307307

308308
// Switch into flowing mode and push the LOB to the file

examples/lobinsert1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var doclobinsert = function(conn, cb) {
8585
return cb(new Error('Error inserting CLOB'), conn);
8686
}
8787
console.log('CLOB inserted from ' + clobInFileName);
88-
cb(null, conn);
88+
return cb(null, conn);
8989
});
9090
};
9191

@@ -103,7 +103,7 @@ var doblobinsert = function(conn, cb) {
103103
return cb(new Error('Error inserting BLOB'), conn);
104104
}
105105
console.log('BLOB inserted from ' + blobInFileName);
106-
cb(null, conn);
106+
return cb(null, conn);
107107
});
108108
};
109109

examples/lobinserttemp.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var docreatetemplob = function (conn, cb) {
6969
return cb(err);
7070
}
7171
console.log("Temporary LOB created with createLob()");
72-
cb(null, conn, templob);
72+
return cb(null, conn, templob);
7373
});
7474
};
7575

@@ -87,7 +87,7 @@ var doloadtemplob = function (conn, templob, cb) {
8787
function(err)
8888
{
8989
console.log("templob.on 'error' event");
90-
cb(err);
90+
return cb(err);
9191
});
9292

9393
templob.on(
@@ -96,7 +96,7 @@ var doloadtemplob = function (conn, templob, cb) {
9696
{
9797
console.log("templob.on 'finish' event");
9898
// The data was loaded into the temporary LOB
99-
cb(null, conn, templob);
99+
return cb(null, conn, templob);
100100
});
101101

102102
console.log('Reading from ' + inFileName);
@@ -106,7 +106,7 @@ var doloadtemplob = function (conn, templob, cb) {
106106
function(err)
107107
{
108108
console.log("inStream.on 'error' event");
109-
cb(err);
109+
return cb(err);
110110
});
111111

112112
inStream.pipe(templob); // copies the text to the temporary LOB

examples/lobplsqltemp.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ var createtemplob = function (conn, cb) {
6969
return cb(err);
7070
}
7171
console.log("Temporary LOB created with createLob()");
72-
cb(null, conn, templob);
72+
return cb(null, conn, templob);
7373
});
7474
};
7575

@@ -87,7 +87,7 @@ var loadtemplob = function (conn, templob, cb) {
8787
function(err)
8888
{
8989
console.log("templob.on 'error' event");
90-
cb(err);
90+
return cb(err);
9191
});
9292

9393
templob.on(
@@ -96,7 +96,7 @@ var loadtemplob = function (conn, templob, cb) {
9696
{
9797
console.log("templob.on 'finish' event");
9898
// The data was loaded into the temporary LOB
99-
cb(null, conn, templob);
99+
return cb(null, conn, templob);
100100
});
101101

102102
console.log('Reading from ' + inFileName);
@@ -106,7 +106,7 @@ var loadtemplob = function (conn, templob, cb) {
106106
function(err)
107107
{
108108
console.log("inStream.on 'error' event");
109-
cb(err);
109+
return cb(err);
110110
});
111111

112112
inStream.pipe(templob); // copies the text to the temporary LOB

examples/lobstream1.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ var dostream = function(lob, cb) {
7575
function(err)
7676
{
7777
// console.log("lob.on 'error' event");
78-
cb(err);
78+
return cb(err);
7979
});
8080
lob.on(
8181
'end',
@@ -88,7 +88,7 @@ var dostream = function(lob, cb) {
8888
function()
8989
{
9090
// console.log("lob.on 'close' event");
91-
cb(null);
91+
return cb(null);
9292
});
9393

9494
var outStream = fs.createWriteStream(outFileName);
@@ -97,7 +97,7 @@ var dostream = function(lob, cb) {
9797
function(err)
9898
{
9999
// console.log("outStream.on 'error' event");
100-
cb(err);
100+
return cb(err);
101101
});
102102

103103
// Switch into flowing mode and push the LOB to the file
@@ -119,7 +119,7 @@ var doquery = function(cb) {
119119
if (lob === null) {
120120
return cb(new Error("LOB was NULL"));
121121
}
122-
cb(null, lob);
122+
return cb(null, lob);
123123
});
124124
};
125125

examples/lobstream2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ var doquery = function(conn, cb) {
7171
if (lob === null) {
7272
return cb(new Error("LOB was NULL"), conn);
7373
}
74-
cb(null, conn, lob);
74+
return cb(null, conn, lob);
7575
});
7676
};
7777

@@ -83,7 +83,7 @@ var dostream = function(conn, clob, cb) {
8383
function(err)
8484
{
8585
console.log("clob.on 'error' event");
86-
cb(err, conn);
86+
return cb(err, conn);
8787
});
8888

8989
// node-oracledb's lob.pieceSize is the number of bytes retrieved
@@ -112,7 +112,7 @@ var dostream = function(conn, clob, cb) {
112112
function()
113113
{
114114
console.log("clob.on 'close' event");
115-
cb(null, conn);
115+
return cb(null, conn);
116116
});
117117
};
118118

0 commit comments

Comments
 (0)