GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — node/test/parallel/test-async-local-storage-contexts.js at main · styfle/node Expand file tree/ Copy pathtest-async-local-storage-contexts.jsMore file actions 35 lines (30 loc) · 880 Bytes / Copy pathtest-async-local-storage-contexts.jsFile metadata and controls35 lines (30 loc) · 880 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 'use strict'; require('../common'); const assert = require('assert'); const vm = require('vm'); const { AsyncLocalStorage } = require('async_hooks'); // Regression test for https://github.com/nodejs/node/issues/38781 const context = vm.createContext({ AsyncLocalStorage, assert }); vm.runInContext(` const storage = new AsyncLocalStorage() async function test() { return storage.run({ test: 'vm' }, async () => { assert.strictEqual(storage.getStore().test, 'vm'); await 42; assert.strictEqual(storage.getStore().test, 'vm'); }); } test() `, context); const storage = new AsyncLocalStorage(); async function test() { return storage.run({ test: 'main context' }, async () => { assert.strictEqual(storage.getStore().test, 'main context'); await 42; assert.strictEqual(storage.getStore().test, 'main context'); }); } test(); |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |