Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-10-12 19:45:26 +0300
committercjihrig <cjihrig@gmail.com>2018-10-14 20:23:16 +0300
commitff8db70bc2eacf1cc494573bb6e8335b82c9da49 (patch)
tree2328de9cf495cda9adcf2a6de732d99d12d0162a /benchmark/http/bench-parser.js
parenteeb2c8fcbbd15d42376249d43fec0cda648b9f72 (diff)
benchmark: add common.binding()
Recently, process.binding() was replaced with internalBinding(). However, internalBinding() is not available on older builds of Node, which are often used for benchmarking purposes. This commit adds a common.binding() to the benchmarks to work around the issue. Hopefully, this can be removed in the not too distant future. PR-URL: https://github.com/nodejs/node/pull/23460 Fixes: https://github.com/nodejs/node/issues/23436 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'benchmark/http/bench-parser.js')
-rw-r--r--benchmark/http/bench-parser.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/benchmark/http/bench-parser.js b/benchmark/http/bench-parser.js
index 8208df11223..a54f0efa75e 100644
--- a/benchmark/http/bench-parser.js
+++ b/benchmark/http/bench-parser.js
@@ -10,8 +10,7 @@ const bench = common.createBenchmark(main, {
});
function main({ len, n }) {
- const { internalBinding } = require('internal/test/binding');
- const { HTTPParser } = internalBinding('http_parser');
+ const { HTTPParser } = common.binding('http_parser');
const REQUEST = HTTPParser.REQUEST;
const kOnHeaders = HTTPParser.kOnHeaders | 0;
const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0;