File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
crates/cli-support/src/js Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1464,10 +1464,7 @@ impl<'a> Context<'a> {
1464
1464
const mem = getUint8Memory();
1465
1465
for (; offset < arg.length; offset++) {{
1466
1466
const code = arg.charCodeAt(offset);
1467
- if (code > 0x7F) {{
1468
- arg = arg.slice(offset);
1469
- break;
1470
- }}
1467
+ if (code > 0x7F) break;
1471
1468
mem[ptr + offset] = code;
1472
1469
}}
1473
1470
}}
@@ -1481,7 +1478,7 @@ impl<'a> Context<'a> {
1481
1478
"
1482
1479
{}
1483
1480
if (offset !== arg.length) {{
1484
- const buf = cachedTextEncoder.encode(arg);
1481
+ const buf = cachedTextEncoder.encode(arg.slice(offset) );
1485
1482
ptr = wasm.__wbindgen_realloc(ptr, size, size = offset + buf.length);
1486
1483
getUint8Memory().set(buf, ptr + offset);
1487
1484
offset += buf.length;
@@ -1499,6 +1496,7 @@ impl<'a> Context<'a> {
1499
1496
"
1500
1497
{}
1501
1498
if (offset !== arg.length) {{
1499
+ arg = arg.slice(offset);
1502
1500
ptr = wasm.__wbindgen_realloc(ptr, size, size = offset + arg.length * 3);
1503
1501
const view = getUint8Memory().subarray(ptr + offset, ptr + size);
1504
1502
offset += cachedTextEncoder.encodeInto(arg, view).written;
You can’t perform that action at this time.
0 commit comments