/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lib/internal/async_local_storage/run_scope.js
31 строка
487 B
Stephen Belanger
async_hooks: add using scopes to AsyncLocalStorage
28 мар 2026, 23:53
Не верифицирован
28 мар 2026, 23:53
5b6091c
Код
Авторство
О чём код?
'use strict'; const { SymbolDispose, } = primordials; class RunScope { #storage; #previousStore; #disposed = false; constructor(storage, store) { this.#storage = storage; this.#previousStore = storage.getStore(); storage.enterWith(store); } dispose() { if (this.#disposed) { return; } this.#disposed = true; this.#storage.enterWith(this.#previousStore); } [SymbolDispose]() { this.dispose(); } } module.exports = RunScope;