11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciconst { AsyncLocalStorage } = require('async_hooks'); 51cb0ef41Sopenharmony_ciconst dc = require('diagnostics_channel'); 61cb0ef41Sopenharmony_ciconst assert = require('assert'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ciconst channel = dc.tracingChannel('test'); 91cb0ef41Sopenharmony_ciconst store = new AsyncLocalStorage(); 101cb0ef41Sopenharmony_ci 111cb0ef41Sopenharmony_ciconst context = { foo: 'bar' }; 121cb0ef41Sopenharmony_ci 131cb0ef41Sopenharmony_cichannel.start.bindStore(store, common.mustCall(() => { 141cb0ef41Sopenharmony_ci return context; 151cb0ef41Sopenharmony_ci})); 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ciassert.strictEqual(store.getStore(), undefined); 181cb0ef41Sopenharmony_cichannel.traceSync(common.mustCall(() => { 191cb0ef41Sopenharmony_ci assert.deepStrictEqual(store.getStore(), context); 201cb0ef41Sopenharmony_ci})); 211cb0ef41Sopenharmony_ciassert.strictEqual(store.getStore(), undefined); 22