This allows us to mark weak/detached references in the heap snapshot. Also mark weak/detached BaseObject with Detachedness::kDetached so that the state of the reference can be displayed by frontend consuming the heap snapshot. PR-URL: https://github.com/nodejs/node/pull/44803 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
19 lines
583 B
JavaScript
19 lines
583 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
require('../common');
|
|
const { validateSnapshotNodes } = require('../common/heap');
|
|
|
|
validateSnapshotNodes('Node / ChannelWrap', []);
|
|
const dns = require('dns');
|
|
validateSnapshotNodes('Node / ChannelWrap', [{}]);
|
|
dns.resolve('localhost', () => {});
|
|
validateSnapshotNodes('Node / ChannelWrap', [
|
|
{
|
|
children: [
|
|
{ node_name: 'Node / NodeAresTask::List', edge_name: 'task_list' },
|
|
// `Node / ChannelWrap` (C++) -> `ChannelWrap` (JS)
|
|
{ node_name: 'ChannelWrap', edge_name: 'wrapped' },
|
|
],
|
|
detachedness: 2
|
|
},
|
|
]);
|