mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
fix(ext/node): add stubs for node:trace_events
(#25628)
This commit is contained in:
parent
597f2d8d4d
commit
ccd1ca8a8b
3 changed files with 30 additions and 0 deletions
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
|
|
27
ext/node/polyfills/trace_events.ts
Normal file
27
ext/node/polyfills/trace_events.ts
Normal 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,
|
||||
};
|
Loading…
Reference in a new issue