Debian Codegraph @

js/src/jit-test/tests/parser/stencil-eager-delazify-empty.js

raw
1 // |jit-test| skip-if: helperThreadCount() === 0 || isLcovEnabled()
2
3 // Extra GCs can empty the StencilCache to reclaim memory. This lines
4 // re-configure the gc-zeal setting to prevent this from happening in this test
5 // case which waits for the cache to contain some entry.
6 if ('gczeal' in this)
7 gczeal(0);
8
9 // Generate a source code with no inner functions.
10 function justVariables(n) {
11 let text = "";
12 for (let i = 0; i < n; i++) {
13 text += `let v${i} = ${i};`;
14 }
15 return text;
16 };
17
18 // Create an extra task to test the case where there is nothing to delazify.
19 let job = offThreadCompileToStencil(justVariables(10000), options);
20
21 const stencil = finishOffThreadStencil(job);
22 evalStencil(stencil, options);