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

Function test

test/parallel/test-async-local-storage-http-parser-leak.js:14–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12const als = new AsyncLocalStorage();
13
14function test() {
15 const store = {};
16 onGC(store, { ongc: common.mustCall(() => { storeGCed = true; }) });
17 let parser;
18 als.run(store, common.mustCall(() => {
19 parser = parsers.alloc();
20 parser.initialize(HTTPParser.RESPONSE, {});
21 }));
22 freeParser(parser);
23}
24
25test();
26global.gc();

Calls 5

onGCFunction · 0.85
freeParserFunction · 0.85
allocMethod · 0.80
runMethod · 0.45
initializeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…