xref: /third_party/node/test/async-hooks/test-embedder.api.async-resource.runInAsyncScope.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/async-hooks/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_cirequire('../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ciconst async_hooks = require('async_hooks');
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ci// Ensure that asyncResource.makeCallback returns the callback return value.
71cb0ef41Sopenharmony_ciconst a = new async_hooks.AsyncResource('foobar');
81cb0ef41Sopenharmony_ciconst ret = a.runInAsyncScope(() => {
91cb0ef41Sopenharmony_ci  return 1729;
101cb0ef41Sopenharmony_ci});
111cb0ef41Sopenharmony_ciassert.strictEqual(ret, 1729);
12

Indexes created Thu Nov 07 10:32:03 CST 2024