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-hooks-async-await.js at main · synapse/node Expand file tree/ Copy pathtest-async-hooks-async-await.jsMore file actions 26 lines (22 loc) · 650 Bytes / Copy pathtest-async-hooks-async-await.jsFile metadata and controls26 lines (22 loc) · 650 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 // Test async-hooks fired on right // asyncIds & triggerAsyncId for async-await 'use strict'; require('../common'); const async_hooks = require('async_hooks'); const assert = require('assert'); const asyncIds = []; async_hooks.createHook({ init: (asyncId, type, triggerAsyncId) => { asyncIds.push([triggerAsyncId, asyncId]); } }).enable(); async function main() { await null; } main().then(() => { // Verify the relationships between async ids // 1 => 2, 2 => 3 etc assert.strictEqual(asyncIds[0][1], asyncIds[1][0]); assert.strictEqual(asyncIds[0][1], asyncIds[3][0]); assert.strictEqual(asyncIds[1][1], asyncIds[2][0]); }); |
| 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. |