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

17 lines
337 B
V
Raw Normal View History

module builtin
fn JS.__panic_abort(&u8, int)
fn JS.__writeln(&u8, int)
// panic calls the `__panic_abort` JS panic handler.
[noreturn]
pub fn panic(s string) {
JS.__panic_abort(s.str, s.len)
for {}
}
// println prints a message with a line end, to stdout. stdout is flushed.
pub fn println(s string) {
JS.__writeln(s.str, s.len)
}