• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1'use strict';
2
3// Test that passing thisArg to runInAsyncScope() works.
4
5const common = require('../common');
6const assert = require('assert');
7const { AsyncResource } = require('async_hooks');
8
9const thisArg = {};
10
11const res = new AsyncResource('fhqwhgads');
12
13function callback() {
14  assert.strictEqual(this, thisArg);
15}
16
17res.runInAsyncScope(common.mustCall(callback), thisArg);
18