From b979893f173cdf90fe9627f266906b64a14b3bd2 Mon Sep 17 00:00:00 2001 From: Zachary Snow Date: Thu, 25 Jul 2024 14:49:19 +0200 Subject: [PATCH] Throw an error in denoFromPlatformCallback. --- examples/play-wav/main.ts | 2 +- src/deno/_callbacks.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/play-wav/main.ts b/examples/play-wav/main.ts index 41ed5ce..be16ab1 100644 --- a/examples/play-wav/main.ts +++ b/examples/play-wav/main.ts @@ -25,7 +25,7 @@ const main = (): number => { wavLengthBox ) == null ) { - console.error("ERROR: Faield to load wav file."); + console.error("ERROR: Failed to load wav file."); return 1; } diff --git a/src/deno/_callbacks.ts b/src/deno/_callbacks.ts index 37d722a..9b7981e 100644 --- a/src/deno/_callbacks.ts +++ b/src/deno/_callbacks.ts @@ -1,5 +1,6 @@ import { DynamicCallbackDefinition } from "../_library.ts"; import { PlatformCallback } from "../_types.ts"; +import { SDLError } from "../error.ts"; import { Callback } from "../types.ts"; interface CallbackInternal extends Callback { @@ -7,10 +8,10 @@ interface CallbackInternal extends Callback { } export function denoFromPlatformCallback( - callback: PlatformCallback, - definition: DynamicCallbackDefinition + _callback: PlatformCallback, + _definition: DynamicCallbackDefinition ): T { - return null as unknown as T; + throw new SDLError(`${denoFromPlatformCallback.name} not implemented.`); } export function denoToPlatformCallback(