mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 23:50:02 -04:00
wasm
This commit is contained in:
parent
a7cbca42d1
commit
6cc293b453
10 changed files with 1050 additions and 91 deletions
17
rewriter/src/lib.rs
Normal file
17
rewriter/src/lib.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
pub mod rewrite;
|
||||
|
||||
use rewrite::rewrite;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern "C" {
|
||||
#[wasm_bindgen(js_namespace = console)]
|
||||
fn log(s: &str);
|
||||
}
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn rewrite_js(js: &str) -> String {
|
||||
log("hello from rust");
|
||||
|
||||
rewrite(js)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue