Skip to content

Commit

Permalink
Remove process.binding() (#564)
Browse files Browse the repository at this point in the history
* Remove process.binding()

* use process.binding if common does not have the HTTPParser
  • Loading branch information
mcollina authored and ronag committed Apr 8, 2021
1 parent c99db2d commit a78c0b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/node/http-parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict'

// TODO: This is not really allowed by Node but it works for now.
const { HTTPParser } = process.binding('http_parser') // eslint-disable-line
const common = require('_http_common')

module.exports = HTTPParser
if (common.HTTPParser) {
module.exports = common.HTTPParser
} else {
// Node 10
module.exports = process.binding('http_parser').HTTPParser // eslint-disable-line
}

0 comments on commit a78c0b7

Please sign in to comment.