1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

js: implement more functions for JS backend (#12167)

This commit is contained in:
playX
2021-10-13 09:40:14 +03:00
committed by GitHub
parent ade5774313
commit d373eba79b
7 changed files with 134 additions and 3 deletions

View File

@@ -112,5 +112,18 @@ pub fn get_host_os() OS {
$if haiku {
return .haiku
}
$if js_node {
return .js_node
}
$if js_freestanding {
return .js_freestanding
}
$if js_browser {
return .js_browser
}
$if js {
return .js_node
}
panic('unknown host OS')
}

View File

@@ -171,6 +171,9 @@ pub fn launch_tool(is_verbose bool, tool_name string, args []string) {
}
$if windows {
exit(os.system('"$tool_exe" $tool_args'))
} $else $if js {
// no way to implement os.execvp in JS backend
exit(os.system('$tool_exe $tool_args'))
} $else {
os.execvp(tool_exe, args) or { panic(err) }
}