1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

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

This commit is contained in:
Divy Srivastava 2024-09-15 08:15:09 +05:30 committed by GitHub
parent 597f2d8d4d
commit ccd1ca8a8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 0 deletions

View file

@ -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",

View file

@ -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,

View file

@ -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,
};