Skip to content

Commit a71fdb9

Browse files
authored
Merge pull request #231 from IanMcCurdy/fixESLintErrors
Fix ESLint errors
2 parents f32f216 + 59fb746 commit a71fdb9

File tree

10 files changed

+15
-19
lines changed

10 files changed

+15
-19
lines changed

examples/csv.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ var query = util._extend({
4141
var segments = params.pathname.match(/^\/?(?:([^.]+)\.)?(.*)/).slice(1);
4242
var schema = segments[0].toUpperCase();
4343
var tablename = segments[1].toUpperCase();
44+
// eslint-disable-next-line no-useless-escape
4445
var filename = tablename.replace(/^\/[^\/]+\//, '').toLowerCase() + '.csv';
4546
filename = path.join(os.tmpdir(), filename);
4647

@@ -128,4 +129,4 @@ function getDefaultParams() {
128129
top: 1000
129130
}
130131
};
131-
}
132+
}

examples/tx1.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ function update(cb) {
9090
client.exec(sql, done);
9191
}
9292

93-
function select(cb) {
94-
var sql = 'select * from PERSONS';
95-
client.exec(sql, cb);
96-
}
97-
9893
function done(err, rows) {
9994
client.end();
10095
if (err) {
@@ -103,4 +98,4 @@ function done(err, rows) {
10398
console.log(util.inspect(rows, {
10499
colors: true
105100
}));
106-
}
101+
}

lib/protocol/ResultSet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,4 +466,4 @@ function collectLobRow(row, done) {
466466
lob.read(receiveLob);
467467
}
468468
next();
469-
}
469+
}

lib/protocol/auth/LDAP.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ LDAP.prototype.initialize = function(buffer, cb) {
7171

7272
// check number of fields
7373
if (serverChallengeData.length < 4) {
74-
var error = new Error('Unexpected number of fields [' + serverChallengeData.length + '] in server challenge (LDAP authentication)');
74+
let error = new Error('Unexpected number of fields [' + serverChallengeData.length + '] in server challenge (LDAP authentication)');
7575
error.code = 'EHDBAUTHPROTOCOL';
7676
cb(error);
7777
return;
@@ -80,7 +80,7 @@ LDAP.prototype.initialize = function(buffer, cb) {
8080
// check client nonce
8181
var clientNonceProof = serverChallengeData[0];
8282
if (!clientNonceProof.equals(this.clientNonce)) {
83-
var error = new Error('Client nonce does not match (LDAP authentication)');
83+
let error = new Error('Client nonce does not match (LDAP authentication)');
8484
error.code = 'EHDBAUTHCLIENTNONCE';
8585
cb(error);
8686
return;
@@ -89,7 +89,7 @@ LDAP.prototype.initialize = function(buffer, cb) {
8989
// check capabilities
9090
var serverCapabilities = serverChallengeData[3];
9191
if (serverCapabilities.readInt8() != DEFAULT_CAPABILITIES) {
92-
var error = new Error('Unsupported capabilities (LDAP authentication)');
92+
let error = new Error('Unsupported capabilities (LDAP authentication)');
9393
error.code = 'EHDBAUTHCAPABILITIES';
9494
cb(error);
9595
return;

lib/protocol/auth/Manager.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Object.defineProperties(Manager.prototype, {
5959
if (this._authMethod && this._authMethod.sessionCookie) {
6060
return this._authMethod.sessionCookie;
6161
}
62+
return undefined;
6263
}
6364
}
6465
});

lib/protocol/auth/SCRAMSHA256.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ SCRAMSHA256.prototype.initialize = function initialize(buffer, cb) {
5353
argumentCount: 1,
5454
buffer: buffer
5555
});
56+
var iterations = 0;
5657
if (this.usePBKDF2) {
57-
var iterations = serverChallengeData[2].readUInt32BE();
58-
} else {
59-
var iterations = 0;
58+
iterations = serverChallengeData[2].readUInt32BE();
6059
}
6160
calculateProofs(
6261
[serverChallengeData[0]],

lib/protocol/data/Options.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function toObject(options, propertyNames) {
3838
var obj = {};
3939

4040
function hasProperty(option) {
41-
return propertyNames.hasOwnProperty(option.name);
41+
return Object.prototype.hasOwnProperty.call(propertyNames, option.name);
4242
}
4343

4444
function setOption(option) {
@@ -185,4 +185,4 @@ function getByteLength(options) {
185185

186186
function getArgumentCount(options) {
187187
return options.length;
188-
}
188+
}

lib/protocol/part/AbstractOptions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ AbstractOptions.prototype.setOptions = function setOptions(options) {
4545
}
4646

4747
function hasProperty(option) {
48-
return self.PROPERTY_NAMES.hasOwnProperty(option.name);
48+
return Object.prototype.hasOwnProperty.call(self.PROPERTY_NAMES, option.name);
4949
}
5050

5151
function setOption(option) {

lib/protocol/request/Segment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,4 @@ function partToBuffer(pd, remainingSize, useCesu8) {
117117
part.argumentCount = m.getArgumentCount(pd.args);
118118
m.write(part, pd.args, remainingSize);
119119
return part.toBuffer(remainingSize);
120-
}
120+
}

lib/util/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ function filter(keys) {
258258
var key;
259259
for (var i = 0; i < keys.length; i++) {
260260
key = keys[i];
261-
if (this.hasOwnProperty(key)) {
261+
if (Object.prototype.hasOwnProperty.call(this, key)) {
262262
obj[key] = this[key];
263263
}
264264
}

0 commit comments

Comments
 (0)