os: fix File.read() in JS backends (fix #20501) (#20633)

This commit is contained in:
GGRei 2024-01-29 14:07:25 +01:00 committed by GitHub
parent cae40ad673
commit 2d68230681
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View file

@ -0,0 +1,8 @@
import os
fn test_read_from_file() {
mut buf := []u8{len: 10}
f := os.open(@FILE)!
n := f.read(mut &buf)!
println(buf[..n])
}