From fb1aa4e6d2339f0a62aa33e19ea403c059b38d43 Mon Sep 17 00:00:00 2001 From: Viktor Marinho <56888067+viktormarinho@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:44:49 -0300 Subject: fix(ext/web): Fix structuredClone Web API type declaration (any -> generic) (#22968) Closes #22958 Used the same type as in: https://github.com/microsoft/TypeScript/blob/main/src/lib/dom.generated.d.ts#L26114 --------- Signed-off-by: Viktor Marinho <56888067+viktormarinho@users.noreply.github.com> --- tests/unit/structured_clone_test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/unit/structured_clone_test.ts') diff --git a/tests/unit/structured_clone_test.ts b/tests/unit/structured_clone_test.ts index 314a276dd..6e0473f9a 100644 --- a/tests/unit/structured_clone_test.ts +++ b/tests/unit/structured_clone_test.ts @@ -9,9 +9,12 @@ Deno.test("self.structuredClone", async () => { const arrayOriginal = ["hello world"]; const channelOriginal = new MessageChannel(); const [arrayCloned, portTransferred] = self - .structuredClone([arrayOriginal, channelOriginal.port2], { - transfer: [channelOriginal.port2], - }); + .structuredClone( + [arrayOriginal, channelOriginal.port2] as [string[], MessagePort], + { + transfer: [channelOriginal.port2], + }, + ); assert(arrayOriginal !== arrayCloned); // not the same identity assertEquals(arrayCloned, arrayOriginal); // but same value channelOriginal.port1.postMessage("1"); -- cgit v1.2.3