summaryrefslogtreecommitdiff
path: root/tests/registry/npm/@denotest/globals/1.0.0/index.js
blob: 542cb63d2b2fb079459b7db8e5f19ab519b1c83f (plain)
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
exports.globalThis = globalThis;
exports.global = global;
exports.process = process;

exports.deleteSetTimeout = function () {
  delete globalThis.setTimeout;
};

exports.getSetTimeout = function () {
  return globalThis.setTimeout;
};

exports.checkWindowGlobal = function () {
  console.log("window" in globalThis);
  console.log(Object.getOwnPropertyDescriptor(globalThis, "window") !== undefined);
}

exports.checkSelfGlobal = function () {
  console.log("self" in globalThis);
  console.log(Object.getOwnPropertyDescriptor(globalThis, "self") !== undefined);
}

exports.getFoo = function () {
  return globalThis.foo;
}