function buildOptimizer(constants, name) {
  // No need to build an optimizer when there are no constants.
  if (constants.length === 0) return '';
  // Use 'this' to avoid going through the scope proxy, which is unnecessary
  // since the optimizer only needs references to the safe global.
  // Destructure the constants from the target scope object.
  return `const {${arrayJoin(constants, ',')}} = this.${name};`;
}
makeEvaluate()
Create an 'evaluate' function with the correct optimizer inserted.

@param {object} context
@param {object} context.evalScope
@param {object} context.moduleLexicals
@param {object} context.globalObject
@param {object} context.scopeTerminator