2020-10-20 00:05:42 -04:00
|
|
|
((window) => {
|
|
|
|
const { EventTarget } = window;
|
|
|
|
|
|
|
|
const illegalConstructorKey = Symbol("illegalConstuctorKey");
|
|
|
|
|
|
|
|
class Window extends EventTarget {
|
|
|
|
constructor(key) {
|
|
|
|
if (key !== illegalConstructorKey) {
|
|
|
|
throw new TypeError("Illegal constructor.");
|
|
|
|
}
|
2020-11-03 10:19:29 -05:00
|
|
|
super();
|
2020-10-20 00:05:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
get [Symbol.toStringTag]() {
|
|
|
|
return "Window";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class WorkerGlobalScope extends EventTarget {
|
|
|
|
constructor(key) {
|
|
|
|
if (key != illegalConstructorKey) {
|
|
|
|
throw new TypeError("Illegal constructor.");
|
|
|
|
}
|
2020-11-03 10:19:29 -05:00
|
|
|
super();
|
2020-10-20 00:05:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
get [Symbol.toStringTag]() {
|
|
|
|
return "WorkerGlobalScope";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class DedicatedWorkerGlobalScope extends WorkerGlobalScope {
|
|
|
|
constructor(key) {
|
|
|
|
if (key != illegalConstructorKey) {
|
|
|
|
throw new TypeError("Illegal constructor.");
|
|
|
|
}
|
2020-11-03 10:19:29 -05:00
|
|
|
super();
|
2020-10-20 00:05:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
get [Symbol.toStringTag]() {
|
|
|
|
return "DedicatedWorkerGlobalScope";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
window.__bootstrap = (window.__bootstrap || {});
|
|
|
|
window.__bootstrap.globalInterfaces = {
|
|
|
|
DedicatedWorkerGlobalScope,
|
|
|
|
Window,
|
|
|
|
WorkerGlobalScope,
|
|
|
|
dedicatedWorkerGlobalScopeConstructorDescriptor: {
|
|
|
|
configurable: true,
|
|
|
|
enumerable: false,
|
|
|
|
value: DedicatedWorkerGlobalScope,
|
|
|
|
writable: true,
|
|
|
|
},
|
|
|
|
windowConstructorDescriptor: {
|
|
|
|
configurable: true,
|
|
|
|
enumerable: false,
|
|
|
|
value: Window,
|
|
|
|
writable: true,
|
|
|
|
},
|
|
|
|
workerGlobalScopeConstructorDescriptor: {
|
|
|
|
configurable: true,
|
|
|
|
enumerable: false,
|
|
|
|
value: WorkerGlobalScope,
|
|
|
|
writable: true,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
})(this);
|