diff --git a/tracers.ts/src/context/tracer-context.ts b/tracers.ts/src/context/tracer-context.ts index e1b8c5d..adef36a 100644 --- a/tracers.ts/src/context/tracer-context.ts +++ b/tracers.ts/src/context/tracer-context.ts @@ -3,22 +3,27 @@ import type { TracerCommand } from '../types'; const createTracerContext = () => { const commands: TracerCommand[] = []; - if (typeof process !== 'undefined' && typeof process.on === 'function') { - process.on('exit', () => { - if (commands.length > 0) { - console.log(commands); - } - }); - } + // if (typeof process !== 'undefined' && typeof process.on === 'function') { + // process.on('exit', () => { + // if (commands.length > 0) { + // console.log(commands); + // } + // }); + // } const getTracerContext = () => { const command = (command: TracerCommand) => { commands.push(command); }; + // TODO: 输出指令序列 + const dump = () => { + return commands; + }; + return { - commands, command, + dump, }; };