mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
js: types (#7108)
This commit is contained in:
@@ -4,14 +4,18 @@
|
||||
|
||||
module builtin
|
||||
|
||||
fn (a any) toString()
|
||||
|
||||
pub fn println(s any) {
|
||||
JS.console.log(s)
|
||||
// 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)
|
||||
JS.process.stdout.write(s.toString())
|
||||
// } $else {
|
||||
// panic('Cannot `print` in a browser, use `println` instead')
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user