版博士V2.0程序
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

98 строки
3.6 KiB

  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const Window_1 = __importDefault(require("./Window"));
  7. /**
  8. * Browser window.
  9. *
  10. * Reference:
  11. * https://developer.mozilla.org/en-US/docs/Web/API/Window.
  12. */
  13. class GlobalWindow extends Window_1.default {
  14. constructor() {
  15. super(...arguments);
  16. // Node.js Globals
  17. this.ArrayBuffer = globalThis.ArrayBuffer;
  18. this.Boolean = globalThis.Boolean;
  19. this.Buffer = globalThis.global ? globalThis.global.Buffer : Buffer;
  20. this.DataView = globalThis.DataView;
  21. this.Date = globalThis.Date;
  22. this.Error = globalThis.Error;
  23. this.EvalError = globalThis.EvalError;
  24. this.Float32Array = globalThis.Float32Array;
  25. this.Float64Array = globalThis.Float64Array;
  26. this.GLOBAL = globalThis.GLOBAL;
  27. this.Infinity = globalThis.Infinity;
  28. this.Int16Array = globalThis.Int16Array;
  29. this.Int32Array = globalThis.Int32Array;
  30. this.Int8Array = globalThis.Int8Array;
  31. this.Intl = globalThis.Intl;
  32. this.JSON = globalThis.JSON;
  33. this.Map = globalThis.Map;
  34. this.Math = globalThis.Math;
  35. this.NaN = globalThis.NaN;
  36. this.Number = globalThis.Number;
  37. this.Promise = globalThis.Promise;
  38. this.RangeError = globalThis.RangeError;
  39. this.ReferenceError = globalThis.ReferenceError;
  40. this.RegExp = globalThis.RegExp;
  41. this.Reflect = globalThis.ArrayBuffer;
  42. this.Set = globalThis.Set;
  43. this.Symbol = globalThis.Symbol;
  44. this.SyntaxError = globalThis.SyntaxError;
  45. this.String = globalThis.String;
  46. this.TypeError = globalThis.TypeError;
  47. this.URIError = globalThis.URIError;
  48. this.Uint16Array = globalThis.Uint16Array;
  49. this.Uint32Array = globalThis.Uint32Array;
  50. this.Uint8Array = globalThis.Uint8Array;
  51. this.Uint8ClampedArray = globalThis.Uint8ClampedArray;
  52. this.WeakMap = globalThis.WeakMap;
  53. this.WeakSet = globalThis.WeakSet;
  54. this.clearImmediate = globalThis.clearImmediate;
  55. this.decodeURI = globalThis.decodeURI;
  56. this.decodeURIComponent = globalThis.decodeURIComponent;
  57. this.encodeURI = globalThis.encodeURI;
  58. this.encodeURIComponent = globalThis.encodeURIComponent;
  59. this.escape = globalThis.escape;
  60. this.global = globalThis.global;
  61. this.isFinite = globalThis.isFinite;
  62. this.isNaN = globalThis.isNaN;
  63. this.parseFloat = globalThis.parseFloat;
  64. this.parseInt = globalThis.parseInt;
  65. this.process = globalThis.process;
  66. this.root = globalThis.ArrayBuffer;
  67. this.setImmediate = globalThis.setImmediate;
  68. this.queueMicrotask = globalThis.queueMicrotask;
  69. this.undefined = globalThis.ArrayBuffer;
  70. this.unescape = globalThis.unescape;
  71. this.gc = globalThis.gc;
  72. this.v8debug = globalThis.v8debug;
  73. this.AbortController = globalThis.AbortController;
  74. this.AbortSignal = globalThis.AbortSignal;
  75. this.Array = globalThis.Array;
  76. this.Object = globalThis.Object;
  77. this.Function = globalThis.Function;
  78. }
  79. /**
  80. * Evaluates code.
  81. *
  82. * @param code Code.
  83. * @returns Result.
  84. */
  85. eval(code) {
  86. return eval(code);
  87. }
  88. /**
  89. * Setup of VM context.
  90. *
  91. * @override
  92. */
  93. _setupVMContext() {
  94. // Do nothing
  95. }
  96. }
  97. exports.default = GlobalWindow;
  98. //# sourceMappingURL=GlobalWindow.js.map