MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / gnRefsForTarget

Function gnRefsForTarget

scripts/devtools_build.mjs:362–381  ·  view source on GitHub ↗
(target, filename)

Source from the content-addressed store, hash-verified

360const gnRefsCache = new Map();
361
362function gnRefsForTarget(target, filename) {
363 let gnRefsPerTarget = gnRefsCache.get(target);
364 if (!gnRefsPerTarget) {
365 gnRefsPerTarget = new Map();
366 gnRefsCache.set(target, gnRefsPerTarget);
367 }
368 let gnRef = gnRefsPerTarget.get(filename);
369 if (!gnRef) {
370 gnRef = (async () => {
371 const cwd = rootPath();
372 const outDir = path.join(rootPath(), 'out', target);
373 const gnExe = vpython3ExecutablePath();
374 const gnArgs = [gnPyPath(), 'refs', outDir, '--as=output', filename];
375 const { stdout } = await spawn(gnExe, gnArgs, { cwd });
376 return stdout.trim().split('\n');
377 })();
378 gnRefsPerTarget.set(filename, gnRef);
379 }
380 return gnRef;
381}
382
383/**
384 *

Callers 1

Calls 9

rootPathFunction · 0.90
vpython3ExecutablePathFunction · 0.90
gnPyPathFunction · 0.90
spawnFunction · 0.85
splitMethod · 0.80
trimMethod · 0.80
getMethod · 0.65
setMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected