Skip to content

Commit 06f3747

Browse files
AndreasMadsenjasnell
authored andcommitted
benchmark: use node v4 syntax in common.js
Using new syntax such as `...args` means that the benchmark suite can't be used with older node versions. This changes the `...args` syntax to a good old `Array.prototype.slice`. Refs: #8932 (comment) PR-URL: #9064 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Brian White <[email protected]>
1 parent 8b152fc commit 06f3747

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

benchmark/common.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,14 @@ Benchmark.prototype.report = function(rate, elapsed) {
208208
});
209209
};
210210

211-
exports.v8ForceOptimization = function(method, ...args) {
211+
exports.v8ForceOptimization = function(method) {
212212
if (typeof method !== 'function')
213213
return;
214+
214215
const v8 = require('v8');
215216
v8.setFlagsFromString('--allow_natives_syntax');
217+
218+
const args = Array.prototype.slice.call(arguments, 1);
216219
method.apply(null, args);
217220
eval('%OptimizeFunctionOnNextCall(method)');
218221
method.apply(null, args);

0 commit comments

Comments
 (0)