compileCode = function (javascriptCode, compress) {
  if (typeof javascriptCode !== 'string') {
    throw new Error(`javascriptCode must be string. ${typeof javascriptCode} was given.`);
  }

  const script = new vm.Script(javascriptCode, {
    produceCachedData: true
  });

  let bytecodeBuffer = (script.createCachedData && script.createCachedData.call)
    ? script.createCachedData()
    : script.cachedData;

  if (compress) bytecodeBuffer = brotliCompressSync(bytecodeBuffer);

  return bytecodeBuffer;
}
Generates v8 bytecode buffer.
@param   {string} javascriptCode JavaScript source that will be compiled to bytecode.
@param   {boolean} compress Compress the bytecode.
@returns {Buffer} The generated bytecode.