Skip to content

Commit 72eca95

Browse files
authored
Merge pull request #1642 from Andrew-Opplaud/master
renamed done to onResult
2 parents d065991 + 76dd307 commit 72eca95

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

lib/commands/quit.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Packet = require('../packets/packet.js');
77
class Quit extends Command {
88
constructor(callback) {
99
super();
10-
this.done = callback;
10+
this.onResult = callback;
1111
}
1212

1313
start(packet, connection) {
@@ -18,8 +18,8 @@ class Quit extends Command {
1818
0,
1919
5
2020
);
21-
if (this.done) {
22-
this.done();
21+
if (this.onResult) {
22+
this.onResult();
2323
}
2424
connection.writePacket(quit);
2525
return null;

test/unit/commands/test-quit.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
const assert = require('assert');
4+
const Quit = require('../../../lib/commands/quit');
5+
6+
const testCallback = err => console.info( err.message );
7+
const testQuit = new Quit( testCallback );
8+
9+
assert.strictEqual( testQuit.onResult, testCallback );

0 commit comments

Comments
 (0)