mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
de762b71f2
currentId is renamed to executionAsyncId triggerId is renamed to triggerAsyncId AsyncResource.triggerId is renamed to AsyncResource.triggerAsyncId AsyncHooksGetCurrentId is renamed to AsyncHooksGetExecutionAsyncId AsyncHooksGetTriggerId is renamed to AsyncHooksGetTriggerAsyncId PR-URL: https://github.com/nodejs/node/pull/13490 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trevor Norris <trev.norris@gmail.com>
35 lines
773 B
JavaScript
35 lines
773 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const commonPath = require.resolve('../common');
|
|
const initHooks = require('./init-hooks');
|
|
const verifyGraph = require('./verify-graph');
|
|
const fs = require('fs');
|
|
|
|
const hooks = initHooks();
|
|
hooks.enable();
|
|
|
|
function onchange() { }
|
|
// install first file watcher
|
|
fs.watchFile(__filename, onchange);
|
|
|
|
// install second file watcher
|
|
fs.watchFile(commonPath, onchange);
|
|
|
|
// remove first file watcher
|
|
fs.unwatchFile(__filename);
|
|
|
|
// remove second file watcher
|
|
fs.unwatchFile(commonPath);
|
|
|
|
process.on('exit', onexit);
|
|
|
|
function onexit() {
|
|
hooks.disable();
|
|
verifyGraph(
|
|
hooks,
|
|
[ { type: 'STATWATCHER', id: 'statwatcher:1', triggerAsyncId: null },
|
|
{ type: 'STATWATCHER', id: 'statwatcher:2', triggerAsyncId: null } ]
|
|
);
|
|
}
|