1'use strict'; 2 3const common = require('../../common'); 4const assert = require('assert'); 5const { runInNewContext } = require(`./build/${common.buildType}/binding`); 6const { performance } = require('perf_hooks'); 7 8// Check that performance.timerify() works when called from another context, 9// for a function created in another context. 10 11const check = runInNewContext(` 12const { performance, assert } = data; 13const timerified = performance.timerify(function() { return []; }); 14assert.strictEqual(timerified().constructor, Array); 15'success'; 16`, { performance, assert }); 17assert.strictEqual(check, 'success'); 18