From ff8db70bc2eacf1cc494573bb6e8335b82c9da49 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Fri, 12 Oct 2018 12:45:26 -0400 Subject: benchmark: add common.binding() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: James M Snell Reviewed-By: Weijia Wang Reviewed-By: Trivikram Kamat --- benchmark/util/type-check.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'benchmark/util') diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index d9acdaedf5..f11471980d 100644 --- a/benchmark/util/type-check.js +++ b/benchmark/util/type-check.js @@ -38,8 +38,7 @@ function main({ type, argument, version, n }) { // For testing, if supplied with an empty type, default to ArrayBufferView. type = type || 'ArrayBufferView'; - const { internalBinding } = require('internal/test/binding'); - const util = internalBinding('util'); + const util = common.binding('util'); const types = require('internal/util/types'); const func = { native: util, js: types }[version][`is${type}`]; -- cgit v1.2.3