After #36394, the following test is broken:
constvm=require('vm');const{ AsyncLocalStorage }=require('async_hooks')constcontext=vm.createContext({
AsyncLocalStorage,
console,});vm.runInContext(` const storage = new AsyncLocalStorage() async function test() { return storage.run({ test: 'vm' }, async () => { console.log(storage.getStore()); await 42; console.log(storage.getStore()); }); } test()`,context);conststorage=newAsyncLocalStorage()asyncfunctiontest(){returnstorage.run({test: 'main context'},async()=>{console.log(storage.getStore());await42;console.log(storage.getStore());});}test()Node 16.1.0:
{ test: 'vm' }
{ test: 'main context' }
{ test: 'vm' }
{ test: 'main context' }
Node 16.2.0:
{ test: 'vm' }
{ test: 'main context' }
undefined
{ test: 'main context' }
After #36394, the following test is broken:
Node 16.1.0:
Node 16.2.0: