mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.gen.js: add source map creation support (inline only, no src) (#10384)
This commit is contained in:
committed by
GitHub
parent
14519bbf5c
commit
96c8d147b2
@@ -166,6 +166,15 @@ pub fn stderr() File {
|
||||
}
|
||||
}
|
||||
|
||||
// read implements the Reader interface.
|
||||
pub fn (f &File) read(mut buf []byte) ?int {
|
||||
if buf.len == 0 {
|
||||
return 0
|
||||
}
|
||||
nbytes := fread(buf.data, 1, buf.len, f.cfile) ?
|
||||
return nbytes
|
||||
}
|
||||
|
||||
// **************************** Write ops ***************************
|
||||
// write implements the Writer interface.
|
||||
// It returns how many bytes were actually written.
|
||||
@@ -439,15 +448,6 @@ pub fn (f &File) read_bytes_into(pos u64, mut buf []byte) ?int {
|
||||
return error('Could not read file')
|
||||
}
|
||||
|
||||
// read implements the Reader interface.
|
||||
pub fn (f &File) read(mut buf []byte) ?int {
|
||||
if buf.len == 0 {
|
||||
return 0
|
||||
}
|
||||
nbytes := fread(buf.data, 1, buf.len, f.cfile) ?
|
||||
return nbytes
|
||||
}
|
||||
|
||||
// read_at reads `buf.len` bytes starting at file byte offset `pos`, in `buf`.
|
||||
[deprecated: 'use File.read_from() instead']
|
||||
pub fn (f &File) read_at(pos u64, mut buf []byte) ?int {
|
||||
|
||||
Reference in New Issue
Block a user