summaryrefslogtreecommitdiff
path: root/test/parallel/test-async-hooks-vm-gc.js
blob: da95e3579dcca4db817c9d11f794f2f4309bdee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Flags: --expose-gc
'use strict';

require('../common');
const asyncHooks = require('async_hooks');
const vm = require('vm');

// This is a regression test for https://github.com/nodejs/node/issues/39019
//
// It should not segfault.

const hook = asyncHooks.createHook({ init() {} }).enable();
vm.createContext();
globalThis.gc();
hook.disable();