From 80183653f4bbf93bd68093d678dfdf0517fbcc89 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Wed, 8 Oct 2025 10:01:06 -0700 Subject: [PATCH] ts is trying to narrow the type too hard --- src/vm.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/vm.ts b/src/vm.ts index f2dacba..9f66dad 100644 --- a/src/vm.ts +++ b/src/vm.ts @@ -26,9 +26,7 @@ export class VM { this.scope = new Scope() } - registerFunction(name: string, fn: NativeFunction | Function) { - // If it's already a NativeFunction, use it directly - // Otherwise, assume it's a JS function and wrap it + registerFunction(name: string, fn: Function) { const wrapped = isWrapped(fn) ? fn as NativeFunction : wrapNative(fn) this.nativeFunctions.set(name, wrapped) }