mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
js,os: fix integer arithmetic; add Process.close() and os.is_readable() for VJS; Make tetris run on JS backend (#12940)
This commit is contained in:
@ -140,3 +140,14 @@ pub fn execvp(cmd string, args []string) ? {
|
||||
pub fn stdin_resume() {
|
||||
#$process.stdin.resume();
|
||||
}
|
||||
|
||||
pub fn is_readable(path string) bool {
|
||||
$if js_node {
|
||||
res := false
|
||||
#try { res.val = $fs.accessSync(path.str,$fs.constants.R_OK); } catch { res.val = false; }
|
||||
|
||||
return res
|
||||
} $else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user