buildAndCheckDepTree = (lang, parent, dummy) => {
  if (!lang) {
    return;
  }
  const cur = { cur: lang, loaded: true, dependencies: [] };
  let deps = lang_dependencies[lang] || [];

  if (!(lang in Prism.languages)) {
    dummy.loaded = false;
    cur.loaded = false;
  }

  if (typeof deps === 'string') {
    deps = [deps];
  }

  deps.forEach(dep => {
    buildAndCheckDepTree(dep, cur, dummy);
  });

  parent.dependencies.push(cur);
}
The dummy node constructs the dependency tree as the root
and maintains the final global loading status (dummy.loaded) for current lang.