mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
0e8bd79cbb
This way we don't end up attempting to SetPromiseHooks on contexts that have already been collected. Fixes: https://github.com/nodejs/node/issues/39019 PR-URL: https://github.com/nodejs/node/pull/39095 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
16 lines
350 B
JavaScript
16 lines
350 B
JavaScript
// 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();
|