ts is trying to narrow the type too hard
This commit is contained in:
parent
78923b3eff
commit
80183653f4
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user