1'use strict'; 2const common = require('../common'); 3const assert = require('assert'); 4const async_hooks = require('async_hooks'); 5 6// Regression test for https://github.com/nodejs/node/issues/27585. 7 8async_hooks.createHook({ init: () => {} }).enable().disable().enable(); 9async_hooks.createHook({ init: () => {} }).enable(); 10 11async function main() { 12 const initialAsyncId = async_hooks.executionAsyncId(); 13 await 0; 14 assert.notStrictEqual(async_hooks.executionAsyncId(), initialAsyncId); 15} 16 17main().then(common.mustCall()); 18