MCPcopy Index your code
hub / github.com/nodejs/node / trackScripts

Function trackScripts

deps/v8/test/inspector/debugger/wasm-scripts-with-name.js:48–73  ·  view source on GitHub ↗
(debuggerParams)

Source from the content-addressed store, hash-verified

46 .then(() => InspectorTest.completeTest());
47
48function trackScripts(debuggerParams) {
49 let {id: sessionId, Protocol} = contextGroup.connect();
50 let scripts = [];
51
52 Protocol.Debugger.enable(debuggerParams);
53 Protocol.Debugger.onScriptParsed(handleScriptParsed);
54
55 async function loadScript({url, scriptId}) {
56 InspectorTest.log(`Session #${sessionId}: Script #${scripts.length} parsed. URL: ${url}.`);
57 let scriptSource;
58 ({result: {scriptSource}} = await Protocol.Debugger.getScriptSource({scriptId}));
59 InspectorTest.log(`Session #${sessionId}: Source for ${url}:`);
60 InspectorTest.log(scriptSource);
61 }
62
63 function handleScriptParsed({params}) {
64 if (params.url.startsWith("wasm://")) {
65 scripts.push(loadScript(params));
66 }
67 }
68
69 return {
70 Protocol,
71 getScripts: () => Promise.all(scripts),
72 };
73}

Callers 1

Calls 4

onScriptParsedMethod · 0.80
allMethod · 0.80
connectMethod · 0.65
enableMethod · 0.45

Tested by

no test coverage detected