Skip to content

Commit 6aba647

Browse files
committed
use process.binding if common does not have the HTTPParser
1 parent d16a9e7 commit 6aba647

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/node/http-parser.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
'use strict'
22

33
// TODO: This is not really allowed by Node but it works for now.
4-
const { HTTPParser } = require('_http_common')
4+
const common = require('_http_common')
55

6-
module.exports = HTTPParser
6+
if (common.HTTPParser) {
7+
module.exports = common.HTTPParser
8+
} else {
9+
// Node 10
10+
module.exports = process.binding('http_parser').HTTPParser // eslint-disable-line
11+
}

0 commit comments

Comments
 (0)