mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
8a830350b2
This fixes an error that could occure by nesting async_hooks calls PR-URL: https://github.com/nodejs/node/pull/14054 Ref: https://github.com/nodejs/node/pull/13755#issuecomment-312616004 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
20 lines
405 B
JavaScript
20 lines
405 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const async_hooks = require('async_hooks');
|
|
const fs = require('fs');
|
|
|
|
const nestedHook = async_hooks.createHook({
|
|
init: common.mustCall()
|
|
});
|
|
|
|
async_hooks.createHook({
|
|
init: common.mustCall((id, type) => {
|
|
nestedHook.enable();
|
|
}, 2)
|
|
}).enable();
|
|
|
|
fs.access(__filename, common.mustCall(() => {
|
|
fs.access(__filename, common.mustCall());
|
|
}));
|