Logo
Explore Help
Sign In
fluencelabs/wasm-bindgen
1
0
Fork 0
You've already forked wasm-bindgen
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-05-09 20:42:20 +00:00
Code Issues Projects Releases Wiki Activity
wasm-bindgen/examples/console_log/src/lib.rs

17 lines
239 B
Rust
Raw Normal View History

Add an example of console.log Also clean up some other exampels
2018-03-09 10:25:19 -08:00
#![feature(proc_macro)]
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern {
Rename `namespace` to `js_namespace` Along the way remove the namespace in Rust as this ended up causing too many problems, alas! The `js_namespace` attribute now almost exclusively modifies the JS bindings, hence the "js" in the name now.
2018-03-22 16:59:48 -07:00
#[wasm_bindgen(js_namespace = console)]
Add an example of console.log Also clean up some other exampels
2018-03-09 10:25:19 -08:00
fn log(s: &str);
}
#[wasm_bindgen]
pub fn run() {
Rename `namespace` to `js_namespace` Along the way remove the namespace in Rust as this ended up causing too many problems, alas! The `js_namespace` attribute now almost exclusively modifies the JS bindings, hence the "js" in the name now.
2018-03-22 16:59:48 -07:00
log("Hello from Rust!");
Add an example of console.log Also clean up some other exampels
2018-03-09 10:25:19 -08:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.7 Page: 63ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API