mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

This makes sure that the tests are run on actual heap snapshots and prints out missing paths when it cannot be found, which makes failures easier to debug, and removes the unnecessary requirement for BaseObjects to be root - which would make the heap snapshot containment view rather noisy and is not conceptually correct, since they are actually held by the BaseObjectList held by the realms. PR-URL: https://github.com/nodejs/node/pull/57417 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
13 lines
489 B
JavaScript
13 lines
489 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: '(shared function info)' }, // 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.
|