Skip to content

Commit ad6ccfc

Browse files
mizchiclaude
andcommitted
fix(viewer): escape template literal in split resizer script
The `${current}px` inside the inline JS script was being interpolated by the MoonBit compiler's outer template literal, causing a ReferenceError in bench/test contexts where no `current` variable existed in scope. Switch to string concatenation to avoid this. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 64e0349 commit ad6ccfc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/cmd/bithub/viewer.mbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ fn split_resizer_script() -> String {
427427
#| const apply = (next) => {
428428
#| if (!desktop.matches) return;
429429
#| current = clamp(next, minSize, computeMax());
430-
#| layout.style.setProperty('--sidebar-size', `${current}px`);
430+
#| layout.style.setProperty('--sidebar-size', current + 'px');
431431
#| resizer.setAttribute('aria-valuemin', String(minSize));
432432
#| resizer.setAttribute('aria-valuemax', String(computeMax()));
433433
#| resizer.setAttribute('aria-valuenow', String(Math.round(current)));

0 commit comments

Comments
 (0)