diff options
| -rw-r--r-- | extensions/broadcast_channel/01_broadcast_channel.js | 2 | ||||
| -rw-r--r-- | extensions/timers/02_performance.js (renamed from runtime/js/40_performance.js) | 12 | ||||
| -rw-r--r-- | extensions/timers/lib.rs | 1 | ||||
| -rw-r--r-- | extensions/web/02_structured_clone.js | 73 | ||||
| -rw-r--r-- | extensions/web/lib.rs | 1 | ||||
| -rw-r--r-- | runtime/js/01_web_util.js | 60 |
6 files changed, 82 insertions, 67 deletions
diff --git a/extensions/broadcast_channel/01_broadcast_channel.js b/extensions/broadcast_channel/01_broadcast_channel.js index 7670b0cfd..c2937105e 100644 --- a/extensions/broadcast_channel/01_broadcast_channel.js +++ b/extensions/broadcast_channel/01_broadcast_channel.js @@ -105,7 +105,7 @@ constructor(name) { super(); - const prefix = "Failed to construct 'broadcastChannel'"; + const prefix = "Failed to construct 'BroadcastChannel'"; webidl.requiredArguments(arguments.length, 1, { prefix }); this[_name] = webidl.converters["DOMString"](name, { diff --git a/runtime/js/40_performance.js b/extensions/timers/02_performance.js index 24c35b5c0..bca98fdbd 100644 --- a/runtime/js/40_performance.js +++ b/extensions/timers/02_performance.js @@ -2,10 +2,9 @@ "use strict"; ((window) => { + const { webidl, structuredClone } = window.__bootstrap; const { opNow } = window.__bootstrap.timers; - const { cloneValue, illegalConstructorKey } = window.__bootstrap.webUtil; - const { requiredArguments } = window.__bootstrap.webUtil; - + const illegalConstructorKey = Symbol("illegalConstructorKey"); const customInspect = Symbol.for("Deno.customInspect"); let performanceEntries = []; @@ -118,7 +117,8 @@ name, options = {}, ) { - requiredArguments("PerformanceMark", arguments.length, 1); + const prefix = "Failed to construct 'PerformanceMark'"; + webidl.requiredArguments(arguments.length, 1, { prefix }); // ensure options is object-ish, or null-ish switch (typeof options) { @@ -138,7 +138,7 @@ if (startTime < 0) { throw new TypeError("startTime cannot be negative"); } - this.#detail = cloneValue(detail); + this.#detail = structuredClone(detail); } toJSON() { @@ -184,7 +184,7 @@ throw new TypeError("Illegal constructor."); } super(name, "measure", startTime, duration, illegalConstructorKey); - this.#detail = cloneValue(detail); + this.#detail = structuredClone(detail); } toJSON() { diff --git a/extensions/timers/lib.rs b/extensions/timers/lib.rs index e9580c4b5..66e7d05ed 100644 --- a/extensions/timers/lib.rs +++ b/extensions/timers/lib.rs @@ -45,6 +45,7 @@ pub fn init<P: TimersPermission + 'static>() -> Extension { .js(include_js_files!( prefix "deno:extensions/timers", "01_timers.js", + "02_performance.js", )) .ops(vec