We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f367a42 + 2f28b8b commit a1c457bCopy full SHA for a1c457b
crates/cli-support/src/js/mod.rs
@@ -1306,13 +1306,12 @@ impl<'a> Context<'a> {
1306
while (true) {{
1307
const view = getUint8Memory().subarray(ptr + writeOffset, ptr + size);
1308
const {{ read, written }} = cachedTextEncoder.encodeInto(arg, view);
1309
- arg = arg.substring(read);
1310
- writeOffset += written;
1311
- if (arg.length === 0) {{
+ if (read === arg.length) {{
1312
break;
1313
}}
1314
- ptr = wasm.__wbindgen_realloc(ptr, size, size * 2);
1315
- size *= 2;
+ arg = arg.substring(read);
+ writeOffset += written;
+ ptr = wasm.__wbindgen_realloc(ptr, size, size += arg.length * 3);
1316
1317
WASM_VECTOR_LEN = writeOffset;
1318
return ptr;
0 commit comments