2019-01-06 08:52:16 +08:00
|
|
|
// Flags: --expose-internals
|
2018-07-11 04:12:23 +08:00
|
|
|
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const { validateSnapshotNodes } = require('../common/heap');
|
|
|
|
const { Worker } = require('worker_threads');
|
|
|
|
|
2018-09-24 05:52:09 +08:00
|
|
|
validateSnapshotNodes('Node / Worker', []);
|
2018-07-11 04:12:23 +08:00
|
|
|
const worker = new Worker('setInterval(() => {}, 100);', { eval: true });
|
2018-09-24 05:52:09 +08:00
|
|
|
validateSnapshotNodes('Node / MessagePort', [
|
2018-07-11 04:12:23 +08:00
|
|
|
{
|
|
|
|
children: [
|
2021-03-26 23:51:08 +08:00
|
|
|
{ node_name: 'Node / MessagePortData', edge_name: 'data' },
|
2018-07-11 04:12:23 +08:00
|
|
|
]
|
2021-03-26 23:51:08 +08:00
|
|
|
},
|
2018-07-11 04:12:23 +08:00
|
|
|
], { loose: true });
|
|
|
|
worker.terminate();
|