diff options
Diffstat (limited to 'ext/node')
-rw-r--r-- | ext/node/lib.rs | 1 | ||||
-rw-r--r-- | ext/node/polyfills/01_require.js | 2 | ||||
-rw-r--r-- | ext/node/polyfills/trace_events.ts | 27 |
3 files changed, 30 insertions, 0 deletions
diff --git a/ext/node/lib.rs b/ext/node/lib.rs index 9cc5e445b..75581c128 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -621,6 +621,7 @@ deno_core::extension!(deno_node, "node:timers" = "timers.ts", "node:timers/promises" = "timers/promises.ts", "node:tls" = "tls.ts", + "node:trace_events" = "trace_events.ts", "node:tty" = "tty.js", "node:url" = "url.ts", "node:util" = "util.ts", diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 156fa1bd0..ebbf92ba6 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -151,6 +151,7 @@ import test from "node:test"; import timers from "node:timers"; import timersPromises from "node:timers/promises"; import tls from "node:tls"; +import traceEvents from "node:trace_events"; import tty from "node:tty"; import url from "node:url"; import utilTypes from "node:util/types"; @@ -260,6 +261,7 @@ function setupBuiltinModules() { timers, "timers/promises": timersPromises, tls, + traceEvents, tty, url, util, diff --git a/ext/node/polyfills/trace_events.ts b/ext/node/polyfills/trace_events.ts new file mode 100644 index 000000000..bb3ea9745 --- /dev/null +++ b/ext/node/polyfills/trace_events.ts @@ -0,0 +1,27 @@ +// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. + +import { ERR_INVALID_ARG_TYPE } from "ext:deno_node/internal/errors.ts"; + +class Tracing { + enabled = false; + categories = ""; +} + +function createTracing(opts) { + if (typeof opts !== "object" || opts == null) { + throw new ERR_INVALID_ARG_TYPE("options", "Object", opts); + } + + return new Tracing(opts); +} + +function getEnabledCategories() { + return ""; +} + +export { createTracing, getEnabledCategories }; + +export default { + createTracing, + getEnabledCategories, +}; |