Skip to content

Commit 88b44fe

Browse files
author
lneves
committed
rename id to _id so it doesn't conflict with RowDataPacket
1 parent 22c2551 commit 88b44fe

32 files changed

+36
-36
lines changed

lib/protocol/Protocol.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Protocol.prototype._enqueue = function(sequence) {
157157
self._emitPacket(packet);
158158
})
159159
.on('timeout', function() {
160-
var err = new Error(sequence.id + ' inactivity timeout');
160+
var err = new Error(sequence._id + ' inactivity timeout');
161161

162162
err.code = 'PROTOCOL_SEQUENCE_TIMEOUT';
163163
err.fatal = true;
@@ -206,7 +206,7 @@ Protocol.prototype._enqueue = function(sequence) {
206206

207207
Protocol.prototype._validateEnqueue = function _validateEnqueue(sequence) {
208208
var err;
209-
var prefix = 'Cannot enqueue ' + sequence.id;
209+
var prefix = 'Cannot enqueue ' + sequence._id;
210210

211211
if (this._fatalError) {
212212
err = new Error(prefix + ' after fatal error.');
@@ -253,7 +253,7 @@ Protocol.prototype._parsePacket = function() {
253253

254254
var Packet = this._determinePacket(sequence);
255255
var packet = new Packet({protocol41: this._config.protocol41});
256-
var packetName = packet.id;
256+
var packetName = packet._id;
257257

258258
// Special case: Faster dispatch, and parsing done inside sequence
259259
if (Packet === Packets.RowDataPacket) {
@@ -447,7 +447,7 @@ Protocol.prototype._debugPacket = function(incoming, packet) {
447447
var direction = incoming
448448
? '<--'
449449
: '-->';
450-
var packetName = packet.id;
450+
var packetName = packet._id;
451451
var threadId = connection && connection.threadId !== null
452452
? ' (' + connection.threadId + ')'
453453
: '';

lib/protocol/packets/AuthSwitchRequestPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function AuthSwitchRequestPacket(options) {
77
this.authMethodData = options.authMethodData;
88
}
99

10-
AuthSwitchRequestPacket.prototype.id = 'AuthSwitchRequestPacket';
10+
AuthSwitchRequestPacket.prototype._id = 'AuthSwitchRequestPacket';
1111

1212
AuthSwitchRequestPacket.prototype.parse = function parse(parser) {
1313
this.status = parser.parseUnsignedNumber(1);

lib/protocol/packets/AuthSwitchResponsePacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function AuthSwitchResponsePacket(options) {
55
this.data = options.data;
66
}
77

8-
AuthSwitchResponsePacket.prototype.id = 'AuthSwitchResponsePacket';
8+
AuthSwitchResponsePacket.prototype._id = 'AuthSwitchResponsePacket';
99

1010
AuthSwitchResponsePacket.prototype.parse = function parse(parser) {
1111
this.data = parser.parsePacketTerminatedBuffer();

lib/protocol/packets/ClientAuthenticationPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function ClientAuthenticationPacket(options) {
1414
this.protocol41 = options.protocol41;
1515
}
1616

17-
ClientAuthenticationPacket.prototype.id = 'ClientAuthenticationPacket';
17+
ClientAuthenticationPacket.prototype._id = 'ClientAuthenticationPacket';
1818

1919
ClientAuthenticationPacket.prototype.parse = function(parser) {
2020
if (this.protocol41) {

lib/protocol/packets/ComChangeUserPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function ComChangeUserPacket(options) {
99
this.charsetNumber = options.charsetNumber;
1010
}
1111

12-
ComChangeUserPacket.prototype.id = 'ComChangeUserPacket';
12+
ComChangeUserPacket.prototype._id = 'ComChangeUserPacket';
1313

1414
ComChangeUserPacket.prototype.parse = function(parser) {
1515
this.command = parser.parseUnsignedNumber(1);

lib/protocol/packets/ComPingPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function ComPingPacket() {
33
this.command = 0x0e;
44
}
55

6-
ComPingPacket.prototype.id = 'ComPingPacket';
6+
ComPingPacket.prototype._id = 'ComPingPacket';
77

88
ComPingPacket.prototype.write = function(writer) {
99
writer.writeUnsignedNumber(1, this.command);

lib/protocol/packets/ComQueryPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function ComQueryPacket(sql) {
44
this.sql = sql;
55
}
66

7-
ComQueryPacket.prototype.id = 'ComQueryPacket';
7+
ComQueryPacket.prototype._id = 'ComQueryPacket';
88

99
ComQueryPacket.prototype.write = function(writer) {
1010
writer.writeUnsignedNumber(1, this.command);

lib/protocol/packets/ComQuitPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function ComQuitPacket() {
33
this.command = 0x01;
44
}
55

6-
ComQuitPacket.prototype.id = 'ComQuitPacket';
6+
ComQuitPacket.prototype._id = 'ComQuitPacket';
77

88
ComQuitPacket.prototype.parse = function parse(parser) {
99
this.command = parser.parseUnsignedNumber(1);

lib/protocol/packets/ComStatisticsPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ function ComStatisticsPacket() {
33
this.command = 0x09;
44
}
55

6-
ComStatisticsPacket.prototype.id = 'ComStatisticsPacket';
6+
ComStatisticsPacket.prototype._id = 'ComStatisticsPacket';
77

88
ComStatisticsPacket.prototype.write = function(writer) {
99
writer.writeUnsignedNumber(1, this.command);

lib/protocol/packets/EmptyPacket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = EmptyPacket;
22
function EmptyPacket() {
33
}
44

5-
EmptyPacket.prototype.id = 'EmptyPacket';
5+
EmptyPacket.prototype._id = 'EmptyPacket';
66

77
EmptyPacket.prototype.parse = function parse() {
88
};

0 commit comments

Comments
 (0)