2020-02-03 07:00:36 +03:00
|
|
|
// Copyright (c) 2019-2020 Alexander Medvednikov. All rights reserved.
|
2019-09-14 23:48:30 +03:00
|
|
|
// Use of this source code is governed by an MIT license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
module builtin
|
|
|
|
|
|
|
|
pub fn exit(code int) {
|
|
|
|
println('js.exit()')
|
|
|
|
}
|
|
|
|
|
|
|
|
// isnil returns true if an object is nil (only for C objects).
|
|
|
|
pub fn isnil(v voidptr) bool {
|
|
|
|
return v == 0
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn panic(s string) {
|
2020-05-04 11:21:25 +03:00
|
|
|
eprintln('V panic: ' + s)
|
2019-09-14 23:48:30 +03:00
|
|
|
exit(1)
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn println(s string) {
|
2019-10-25 11:24:34 +03:00
|
|
|
#console.log(s.str)
|
2019-09-14 23:48:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn eprintln(s string) {
|
2019-10-19 15:42:37 +03:00
|
|
|
#console.error(s)
|
2019-09-14 23:48:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
pub fn print(s string) {
|
|
|
|
#console.log(s)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|