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:
@@ -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')
|
||||
}
|
||||
|
||||
@@ -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) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user