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

js: use prefixed names for functions and global symbols (#11387)

This commit is contained in:
playX
2021-09-08 20:30:46 +03:00
committed by GitHub
parent 96d4a0777f
commit 72089c4feb
25 changed files with 1895 additions and 357 deletions

View File

@@ -10,7 +10,7 @@ pub const (
)
$if js_node {
#$process.argv.forEach(function(val,index) { args.arr[index] = new string(val); })
#$process.argv.forEach(function(val,index) { os__args.arr[index] = new string(val); })
}
// real_path returns the full absolute path for fpath, with all relative ../../, symlinks and so on resolved.
@@ -55,7 +55,7 @@ pub fn chown(path string, owner int, group int) {
pub fn temp_dir() string {
mut res := ''
$if js_node {
#res = new builtin.string($os.tmpdir())
#res = new string($os.tmpdir())
}
return res
}
@@ -63,7 +63,7 @@ pub fn temp_dir() string {
pub fn home_dir() string {
mut res := ''
$if js_node {
#res = new builtin.string($os.homedir())
#res = new string($os.homedir())
}
return res
}
@@ -87,8 +87,8 @@ pub fn execute(cmd string) Result {
mut stdout := ''
#let commands = cmd.str.split(' ');
#let output = $child_process.spawnSync(commands[0],commands.slice(1,commands.length));
#exit_code = new builtin.int(output.status)
#stdout = new builtin.string(output.stdout + '')
#exit_code = new int(output.status)
#stdout = newstring(output.stdout + '')
return Result{
exit_code: exit_code