We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4de5ccf commit 56488bfCopy full SHA for 56488bf
1 file changed
lib/node-static.js
@@ -194,12 +194,11 @@ class Server {
194
}
195
196
serve (req, res, callback) {
197
- const that = this,
198
- promise = new(events.EventEmitter);
+ const promise = new(events.EventEmitter);
199
let pathname;
200
201
- const finish = function (status, headers, streaming) {
202
- that.finish(status, headers, req, res, promise, callback, streaming);
+ const finish = (status, headers, streaming) => {
+ this.finish(status, headers, req, res, promise, callback, streaming);
203
};
204
205
try {
@@ -211,8 +210,8 @@ class Server {
211
210
});
212
213
214
- process.nextTick(function () {
215
- that.servePath(pathname, 200, {}, req, res, finish).on('success', function (result) {
+ process.nextTick(() => {
+ this.servePath(pathname, 200, {}, req, res, finish).on('success', function (result) {
216
promise.emit('success', result);
217
}).on('error', function (err) {
218
promise.emit('error');
0 commit comments