node/test/pummel/test-heapdump-vm-script.js
Joyee Cheung e98d902b1f
test: update test-heapdump-vm-script.js for new version of V8
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
2026-06-22 08:34:05 +02:00

13 lines
494 B
JavaScript

'use strict';
require('../common');
const { validateByRetainingPath } = require('../common/heap');
const source = 'const foo = 123';
const script = require('vm').createScript(source);
validateByRetainingPath('Node / ContextifyScript', [
{ node_name: 'system / SharedFunctionInfo' }, // This is the UnboundScript referenced by ContextifyScript.
{ edge_name: 'script' },
{ edge_name: 'source', node_type: 'string', node_name: source },
]);
console.log(script); // Keep the script alive.