• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Flags: --expose-internals
2'use strict';
3const common = require('../common');
4const { validateSnapshotNodes } = require('../common/heap');
5const zlib = require('zlib');
6
7validateSnapshotNodes('Node / ZlibStream', []);
8
9const gzip = zlib.createGzip();
10validateSnapshotNodes('Node / ZlibStream', [
11  {
12    children: [
13      { node_name: 'Zlib', edge_name: 'native_to_javascript' },
14      // No entry for memory because zlib memory is initialized lazily.
15    ],
16  },
17]);
18
19gzip.write('hello world', common.mustCall(() => {
20  validateSnapshotNodes('Node / ZlibStream', [
21    {
22      children: [
23        { node_name: 'Zlib', edge_name: 'native_to_javascript' },
24        { node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' },
25      ],
26    },
27  ]);
28}));
29