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

js,gg: more work on porting gg to JS backend (#12903)

This commit is contained in:
playX
2021-12-20 16:18:21 +03:00
committed by GitHub
parent f81654e3a7
commit 5f0160bf11
14 changed files with 392 additions and 219 deletions

View File

@ -3,6 +3,7 @@ module os
$if js_node {
#global.$ENV = $process.env
} $else {
#const global = $global;
#global.$ENV = {}
}

View File

@ -7,8 +7,9 @@ pub mut:
is_opened bool
}
#const $buffer = require('buffer');
$if !js_browser {
#const $buffer = require('buffer');
}
// todo(playX): __as_cast is broken here
/*
pub struct ErrFileNotOpened {

View File

@ -1,8 +1,10 @@
module os
#const $fs = require('fs');
#const $path = require('path');
#const tty = require('tty')
$if js_node {
#const $fs = require('fs');
#const $path = require('path');
#const tty = require('tty')
}
pub const (
path_delimiter = '/'

View File

@ -1,6 +1,8 @@
module os
#const $child_process = require('child_process')
$if js_node {
#const $child_process = require('child_process')
}
// new_process - create a new process descriptor
// NB: new does NOT start the new process.