aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/trace_events.exports.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/trace_events.exports.js')
-rw-r--r--src/bun.js/trace_events.exports.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/bun.js/trace_events.exports.js b/src/bun.js/trace_events.exports.js
new file mode 100644
index 000000000..44ee28203
--- /dev/null
+++ b/src/bun.js/trace_events.exports.js
@@ -0,0 +1,33 @@
+// This is a stub! This is not actually implemented yet.
+
+class Tracing {
+ enabled = false;
+ categories = "";
+}
+
+function ERR_INVALID_ARG_TYPE(name, type, value) {
+ const err = new TypeError(`The "${name}" argument must be of type ${type}. Received ${value}`);
+ err.code = "ERR_INVALID_ARG_TYPE";
+ return err;
+}
+
+function createTracing(opts) {
+ if (typeof opts !== "object" || opts == null) {
+ throw new ERR_INVALID_ARG_TYPE("options", "Object", opts);
+ }
+
+ // TODO: validate categories
+ return new Tracing(opts);
+}
+
+function getEnabledCategories() {
+ return "";
+}
+
+var defaultObject = {
+ createTracing,
+ getEnabledCategories,
+ [Symbol.for("CommonJS")]: 0,
+};
+
+export { defaultObject as default, createTracing, getEnabledCategories };