remove leftover limits from haku-wasm

This commit is contained in:
りき萌 2025-09-01 21:13:32 +02:00
parent 64e2489979
commit 09f2292e62
2 changed files with 9 additions and 22 deletions

View file

@ -217,9 +217,14 @@ export class Haku {
console.groupCollapsed("construct Haku");
{
let pLimits = allocCheck(w.haku_limits_new());
for (let name of Object.keys(limits)) {
w[`haku_limits_set_${name}`](pLimits, limits[name]);
}
w.haku_limits_set_max_source_code_len(pLimits, limits.max_source_code_len);
w.haku_limits_set_max_chunks(pLimits, limits.max_chunks);
w.haku_limits_set_max_defs(pLimits, limits.max_defs);
w.haku_limits_set_max_tags(pLimits, limits.max_tags);
w.haku_limits_set_max_tokens(pLimits, limits.max_tokens);
w.haku_limits_set_max_parser_events(pLimits, limits.max_parser_events);
w.haku_limits_set_ast_capacity(pLimits, limits.ast_capacity);
w.haku_limits_set_chunk_capacity(pLimits, limits.chunk_capacity);
this.#pInstance = allocCheck(w.haku_instance_new(pLimits));