mirror of
https://github.com/denoland/deno.git
synced 2025-09-30 06:04:48 +00:00
fix: webidl utils and align Event
to spec (#9470)
This commit is contained in:
parent
d2d7dc8d67
commit
af460fc464
11 changed files with 1117 additions and 192 deletions
|
@ -1,70 +0,0 @@
|
|||
"use strict";
|
||||
((window) => {
|
||||
const { EventTarget } = window;
|
||||
|
||||
const illegalConstructorKey = Symbol("illegalConstructorKey");
|
||||
|
||||
class Window extends EventTarget {
|
||||
constructor(key = null) {
|
||||
if (key !== illegalConstructorKey) {
|
||||
throw new TypeError("Illegal constructor.");
|
||||
}
|
||||
super();
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return "Window";
|
||||
}
|
||||
}
|
||||
|
||||
class WorkerGlobalScope extends EventTarget {
|
||||
constructor(key = null) {
|
||||
if (key != illegalConstructorKey) {
|
||||
throw new TypeError("Illegal constructor.");
|
||||
}
|
||||
super();
|
||||
}
|
||||
|
||||
get [Symbol.toStringTag]() {
|
||||
return "WorkerGlobalScope";
|
||||
}
|
||||
}
|
||||
|
||||
class DedicatedWorkerGlobalScope extends WorkerGlobalScope {
|
||||
constructor(key = null) {
|
||||
if (key != illegalConstructorKey) {
|
||||
throw new TypeError("Illegal constructor.");
|
||||
}
|
||||
super();
|
||||
}
|
||||
|
||||
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);
|
Loading…
Add table
Add a link
Reference in a new issue