Skip to content

Commit d2d9616

Browse files
committedJan 4, 2022
user super and arrow fn
1 parent 17cf193 commit d2d9616

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
 

‎lib/test.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,16 @@ class Test extends Request {
111111
* @api public
112112
*/
113113
end(fn) {
114-
const self = this;
115114
const server = this._server;
116-
const end = Request.prototype.end;
117115

118-
end.call(this, function (err, res) {
116+
super.end((err, res) => {
117+
const localAssert = () => {
118+
this.assert(err, res, fn);
119+
};
120+
119121
if (server && server._handle) return server.close(localAssert);
120122

121123
localAssert();
122-
123-
function localAssert() {
124-
self.assert(err, res, fn);
125-
}
126124
});
127125

128126
return this;

0 commit comments

Comments
 (0)
Please sign in to comment.