function initScript(script, sizes, code) {
  const $cache = script.$cache || (script.$cache = {});
  const meta = script.meta || {};
  const { custom } = script;
  const localeName = getLocaleString(meta, kName);
  const desc = [
    meta[kName],
    localeName,
    meta[kDescription],
    getLocaleString(meta, kDescription),
    custom[kName],
    custom[kDescription],
  ]::trueJoin('\n');
  const name = custom[kName] || localeName;
  let total = 0;
  let str = '';
  sizes.forEach((val, i) => {
    total += val;
    if (val) str += `${SIZE_TITLES[i]}: ${formatByteLength(val)}\n`;
  });
  $cache.desc = desc;
  $cache.name = name;
  $cache.lowerName = name.toLocaleLowerCase();
  $cache.tags = custom.tags || '';
  $cache.size = formatByteLength(total, true).replace(' ', '');
  $cache.sizes = str.slice(0, -1).replace(/\x20/g, '\xA0').replace(/[^B]$/gm, '$&B');
  $cache.sizeNum = total;
  $cache[kStorageSize] = sizes[2];
  if (code) $cache.code = code;
  script.$canUpdate = getScriptUpdateUrl(script)
    && (script.config.shouldUpdate ? 1 : -1 /* manual */);
  loadScriptIcon(script, store, true);
}
@param {VMScript} script
@param {number[]} sizes
@param {string} [code]