Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: trim read-sequence buffer to actual bytes read

make-string + read-sequence can leave trailing null bytes which
cause QuickJS SyntaxError. Trim to actual character count.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+6 -4
+6 -4
fedac/native/cl/js-bridge.lisp
··· 182 182 183 183 (defun js-load-piece (path) 184 184 "Load a .mjs piece file and detect lifecycle functions." 185 - (let ((code (with-open-file (s path :direction :input :if-does-not-exist nil) 185 + (let ((code (with-open-file (s path :direction :input :if-does-not-exist nil 186 + :external-format :utf-8) 186 187 (when s 187 - (let ((buf (make-string (file-length s)))) 188 - (read-sequence buf s) 189 - buf))))) 188 + (let* ((buf (make-string (file-length s))) 189 + (n (read-sequence buf s))) 190 + ;; Trim to actual bytes read (avoid trailing nulls) 191 + (subseq buf 0 n)))))) 190 192 (unless code 191 193 (format *error-output* "[js-bridge] Piece not found: ~A~%" path) 192 194 (return-from js-load-piece nil))