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

Function testProduceConsume

test/parallel/test-vm-cached-data.js:38–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36}
37
38function testProduceConsume() {
39 const source = getSource('original');
40
41 const data = produce(source);
42
43 for (const cachedData of common.getArrayBufferViews(data)) {
44 // It should consume code cache
45 const script = new vm.Script(source, {
46 cachedData
47 });
48 assert(!script.cachedDataRejected);
49 assert.strictEqual(script.runInThisContext()(), 'original');
50 }
51}
52testProduceConsume();
53
54function testProduceMultiple() {

Callers 1

Calls 4

runInThisContextMethod · 0.95
produceFunction · 0.85
getSourceFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected