go-engine 0.1.5

The wrapper of the Goscript project.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use wasm_bindgen::prelude::*;

#[wasm_bindgen]
extern "C" {
    // Use `js_namespace` here to bind `console.log(..)` instead of just
    // `log(..)`
    #[wasm_bindgen(js_namespace = console)]
    fn log(s: &str);
}

/// Logs a message to the console via wasm_bindgen.
pub(crate) fn console_log(s: &str) {
    log(s);
}