summaryrefslogtreecommitdiff
path: root/op_crates
diff options
context:
space:
mode:
Diffstat (limited to 'op_crates')
-rw-r--r--op_crates/web/02_abort_signal.js2
-rw-r--r--op_crates/web/03_global_interfaces.js6
-rw-r--r--op_crates/web/abort_controller_test.js6
3 files changed, 10 insertions, 4 deletions
diff --git a/op_crates/web/02_abort_signal.js b/op_crates/web/02_abort_signal.js
index 354cd1fbf..5ee047c36 100644
--- a/op_crates/web/02_abort_signal.js
+++ b/op_crates/web/02_abort_signal.js
@@ -31,7 +31,7 @@
this.#abortAlgorithms.delete(algorithm);
}
- constructor(key) {
+ constructor(key = null) {
if (key != illegalConstructorKey) {
throw new TypeError("Illegal constructor.");
}
diff --git a/op_crates/web/03_global_interfaces.js b/op_crates/web/03_global_interfaces.js
index 3c6b5695b..7ade64cc1 100644
--- a/op_crates/web/03_global_interfaces.js
+++ b/op_crates/web/03_global_interfaces.js
@@ -4,7 +4,7 @@
const illegalConstructorKey = Symbol("illegalConstuctorKey");
class Window extends EventTarget {
- constructor(key) {
+ constructor(key = null) {
if (key !== illegalConstructorKey) {
throw new TypeError("Illegal constructor.");
}
@@ -17,7 +17,7 @@
}
class WorkerGlobalScope extends EventTarget {
- constructor(key) {
+ constructor(key = null) {
if (key != illegalConstructorKey) {
throw new TypeError("Illegal constructor.");
}
@@ -30,7 +30,7 @@
}
class DedicatedWorkerGlobalScope extends WorkerGlobalScope {
- constructor(key) {
+ constructor(key = null) {
if (key != illegalConstructorKey) {
throw new TypeError("Illegal constructor.");
}
diff --git a/op_crates/web/abort_controller_test.js b/op_crates/web/abort_controller_test.js
index a65bc69ff..2f26ade28 100644
--- a/op_crates/web/abort_controller_test.js
+++ b/op_crates/web/abort_controller_test.js
@@ -118,6 +118,11 @@ function abortSignalHandlerLocation() {
const abortHandler = Object.getOwnPropertyDescriptor(signal, "onabort");
assertEquals(abortHandler, undefined);
}
+function abortSignalLength() {
+ const controller = new AbortController();
+ const { signal } = controller;
+ assertEquals(signal.constructor.length, 0);
+}
function main() {
basicAbortController();
signalCallsOnabort();
@@ -128,6 +133,7 @@ function main() {
abortSignalEventOrder();
abortSignalEventOrderComplex();
abortSignalHandlerLocation();
+ abortSignalLength();
}
main();