aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/trace_events.exports.js
blob: 44ee28203e148ab4d2be8afe99b9f03403f6c478 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 };