mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 06:19:07 +00:00

PR-URL: https://github.com/nodejs/node/pull/31950 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
18 lines
427 B
JavaScript
18 lines
427 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const {
|
|
AsyncLocalStorage,
|
|
executionAsyncResource
|
|
} = require('async_hooks');
|
|
|
|
const asyncLocalStorage = new AsyncLocalStorage();
|
|
|
|
const outerResource = executionAsyncResource();
|
|
|
|
asyncLocalStorage.run(new Map(), () => {
|
|
assert.notStrictEqual(executionAsyncResource(), outerResource);
|
|
});
|
|
|
|
assert.strictEqual(executionAsyncResource(), outerResource);
|