function buildPolyfillExpression(object, property, coreJs3Module) {
  const qt = (/** @type {string} */ token) =>
    `['"]${token}['"]`; // don't worry about matching string delims

  let expression = '';

  if (object) {
    // String.prototype.startsWith =
    expression += `${object}\\.${property}\\s?=[^=]`;
  } else {
    // Promise =
    // window.Promise =// Promise =Z
    // but not: SomePromise =
    expression += `(?:window\\.|[\\s;]+)${property}\\s?=[^=]`;
  }

  // String.prototype['startsWith'] =
  if (object) {
    expression += `|${object}\\[${qt(property)}\\]\\s?=[^=]`;
  }

  // Object.defineProperty(String.prototype, 'startsWith'
  expression += `|defineProperty\\(${object || 'window'},\\s?${qt(property)}`;

  // es-shims
  // no(Object,{entries:r},{entries:function
  if (object) {
    expression += `|\\(${object},\\s*{${property}:.*},\\s*{${property}`;
  }

  // core-js
  if (object) {
    const objectWithoutPrototype = object.replace('.prototype', '');
    // e(e.S,"Object",{values
    // Minified + mangled pattern found in CDN babel-polyfill.
    // see https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/7.2.5/polyfill.min.js
    // TODO: perhaps this is the wrong place to check for a CDN polyfill. Remove?
    // expression += `|;e\\([^,]+,${qt(objectWithoutPrototype)},{${property}:`;

    // core-js@3 minified pattern.
    // {target:"Array",proto:true},{fill:fill
    // {target:"Array",proto:true,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH},{filter:
    expression += `|{target:${qt(objectWithoutPrototype)}[^;]*},{${property}:`;
  } else {
    // Detect polyfills for new classes: Map, Set, WeakSet, etc.
    // TODO: so far, no class polyfills are enabled for detection.
    // See `modulesToSkip` in create-polyfill-module-data.js

    // collection("Map",
    // expression += `|collection\\(${qt(property)},`;
  }

  // Un-minified code may have module names.
  // core-js/modules/es.object.is-frozen
  expression += `|${coreJs3Module.replaceAll('.', '\\.')}(?:\\.js)?"`;

  return expression;
}
@param {string?} object
@param {string} property
@param {string} coreJs3Module