From 559018c9e83b67992f4561d96136247f884b4d3c Mon Sep 17 00:00:00 2001 From: Jake Teton-Landis Date: Tue, 3 Sep 2024 18:29:28 -0400 Subject: [PATCH] turn off ttylog --- .../src/quickjs-in-quickjs-node-test.mts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts b/packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts index b0ae3ea4..022e781e 100644 --- a/packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts +++ b/packages/quickjs-emscripten/src/quickjs-in-quickjs-node-test.mts @@ -7,10 +7,14 @@ import assert from "node:assert" import { getQuickJS } from "./index.js" import type { JSModuleLoader, JSModuleNormalizer, QuickJSHandle, QuickJSContext } from "./index.js" +const DEBUG = false + const ttyLog = (...args: unknown[]) => { - const fd = fs.openSync("/dev/tty", "w") - fs.writeSync(fd, util.format(...args) + "\n") - fs.closeSync(fd) + if (DEBUG) { + const fd = fs.openSync("/dev/tty", "w") + fs.writeSync(fd, util.format(...args) + "\n") + fs.closeSync(fd) + } } const QuickJS = await getQuickJS()