mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
873e5ce54a
PR-URL: https://github.com/nodejs/node/pull/46610 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
29 lines
756 B
JavaScript
29 lines
756 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
const common = require('../common');
|
|
const { validateSnapshotNodes } = require('../common/heap');
|
|
const zlib = require('zlib');
|
|
|
|
validateSnapshotNodes('Node / ZlibStream', []);
|
|
|
|
const gzip = zlib.createGzip();
|
|
validateSnapshotNodes('Node / ZlibStream', [
|
|
{
|
|
children: [
|
|
{ node_name: 'Zlib', edge_name: 'native_to_javascript' },
|
|
// No entry for memory because zlib memory is initialized lazily.
|
|
],
|
|
},
|
|
]);
|
|
|
|
gzip.write('hello world', common.mustCall(() => {
|
|
validateSnapshotNodes('Node / ZlibStream', [
|
|
{
|
|
children: [
|
|
{ node_name: 'Zlib', edge_name: 'native_to_javascript' },
|
|
{ node_name: 'Node / zlib_memory', edge_name: 'zlib_memory' },
|
|
],
|
|
},
|
|
]);
|
|
}));
|