Skip to content

Commit

Permalink
cleanup: remove setImmediate support check
Browse files Browse the repository at this point in the history
`setImmediate` is available since Node.js v0.9.1
  • Loading branch information
Phillip9587 committed Nov 25, 2024
1 parent 401ec84 commit 332dff8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ var statuses = require('statuses')
var DOUBLE_SPACE_REGEXP = /\x20{2}/g
var NEWLINE_REGEXP = /\n/g

/* istanbul ignore next */
var defer = typeof setImmediate === 'function'
? setImmediate
: function (fn) { process.nextTick(fn.bind.apply(fn, arguments)) }
var isFinished = onFinished.isFinished

/**
Expand Down Expand Up @@ -118,7 +114,7 @@ function finalhandler (req, res, options) {

// schedule onerror callback
if (err && onerror) {
defer(onerror, err, req, res)
setImmediate(onerror, err, req, res)
}

// cannot actually respond
Expand Down

0 comments on commit 332dff8

Please sign in to comment.