Skip to content

Commit d4a5d7b

Browse files
committed
style: document use of number argument for 5.0's loadbuffer
1 parent dd116a8 commit d4a5d7b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/binding-factory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ const lauxBindings: Record<string, lauxBindingFactoryFunc> = {
168168
const ptr = luaGlue.allocateUTF8(s) as unknown;
169169
return (this as LauxLib).luaL_loadbuffer(L, ptr as string, luaGlue.lengthBytesUTF8(s), s);
170170
},
171+
// Note that s has a "number" type, so we can pass a raw pointer
171172
luaL_loadbuffer: luaGlue.cwrap("luaL_loadbuffer", "number", ["number", "number", "number", "string"]),
172173
luaL_newstate: luaGlue.cwrap("lua_open", "number", []),
173174
}

0 commit comments

Comments
 (0)