Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ext/node): add stubs for node:trace_events #25628

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ext/node/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions ext/node/polyfills/01_require.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,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";
Expand Down Expand Up @@ -258,6 +259,7 @@ function setupBuiltinModules() {
timers,
"timers/promises": timersPromises,
tls,
traceEvents,
tty,
url,
util,
Expand Down
27 changes: 27 additions & 0 deletions ext/node/polyfills/trace_events.ts
Original file line number Diff line number Diff line change
@@ -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,
};