mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
v.gen.js: fix method calls and other codegen parts, rand module compiles (#11205)
This commit is contained in:
@@ -6,34 +6,6 @@ module builtin
|
||||
|
||||
fn (a any) toString()
|
||||
|
||||
pub fn println(s any) {
|
||||
// Quickfix to properly print basic types
|
||||
// TODO: Add proper detection code for this
|
||||
JS.console.log(s.toString())
|
||||
}
|
||||
|
||||
pub fn print(s any) {
|
||||
// TODO
|
||||
// $if js.node {
|
||||
JS.process.stdout.write(s.toString())
|
||||
// } $else {
|
||||
// panic('Cannot `print` in a browser, use `println` instead')
|
||||
// }
|
||||
}
|
||||
|
||||
pub fn eprintln(s any) {
|
||||
JS.console.error(s.toString())
|
||||
}
|
||||
|
||||
pub fn eprint(s any) {
|
||||
// TODO
|
||||
// $if js.node {
|
||||
JS.process.stderr.write(s.toString())
|
||||
// } $else {
|
||||
// panic('Cannot `eprint` in a browser, use `eprintln` instead')
|
||||
// }
|
||||
}
|
||||
|
||||
// Exits the process in node, and halts execution in the browser
|
||||
// because `process.exit` is undefined. Workaround for not having
|
||||
// a 'real' way to exit in the browser.
|
||||
|
||||
Reference in New Issue
Block a user