Skip to content

Commit 8ba6ab4

Browse files
committed
Improved missing function handling in safeCWrap
1 parent d30ee1e commit 8ba6ab4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/binding-factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ function safeCwrap(
88
argTypes: Emscripten.JSType[],
99
opts?: Emscripten.CCallOpts
1010
): (...args: any[]) => any {
11-
try {
11+
if ((glue as any)["_" + ident]) {
1212
return glue.cwrap(ident, returnType, argTypes, opts);
13-
} catch {
13+
} else {
1414
return _args => {
1515
throw `${ident} not supported in this Lua version!`;
1616
};

0 commit comments

Comments
 (0)