From 7a0670a9512981cee18d1960db46a3b57844595d Mon Sep 17 00:00:00 2001 From: "Kevin (Kun) \"Kassimo\" Qian" Date: Sat, 22 Sep 2018 00:59:26 -0700 Subject: Implement deno.trace() (#795) --- js/dispatch.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/dispatch.ts') diff --git a/js/dispatch.ts b/js/dispatch.ts index 8c2514c32..037b77a85 100644 --- a/js/dispatch.ts +++ b/js/dispatch.ts @@ -4,6 +4,7 @@ import { flatbuffers } from "flatbuffers"; import * as fbs from "gen/msg_generated"; import * as errors from "./errors"; import * as util from "./util"; +import { maybePushTrace } from "./trace"; let nextCmdId = 0; const promiseTable = new Map>(); @@ -29,6 +30,7 @@ export function sendAsync( msgType: fbs.Any, msg: flatbuffers.Offset ): Promise { + maybePushTrace(msgType, false); // add to trace if tracing const [cmdId, resBuf] = sendInternal(builder, msgType, msg, false); util.assert(resBuf == null); const promise = util.createResolvable(); @@ -42,6 +44,7 @@ export function sendSync( msgType: fbs.Any, msg: flatbuffers.Offset ): null | fbs.Base { + maybePushTrace(msgType, true); // add to trace if tracing const [cmdId, resBuf] = sendInternal(builder, msgType, msg, true); util.assert(cmdId >= 0); if (resBuf == null) { -- cgit v1.2.3