Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard authored and Richard committed Nov 6, 2020
1 parent b837348 commit 6ac3596
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "js"
version = "0.2.1"
version = "0.2.2"
authors = ["Richard Anaya"]
edition = "2018"
description = "Call JavaScript from WebAssembly"
Expand Down
3 changes: 2 additions & 1 deletion js-wasm.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ async function load_and_run_wasm(wasmURL) {
undefined,
null,
self,
typeof document != "undefined" ? document : null
typeof document != "undefined" ? document : null,
typeof document != "undefined" ? document.body : null
],
utf8dec: new TextDecoder("utf-8"),
utf8enc: new TextEncoder("utf-8"),
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pub const JS_UNDEFINED: usize = 1;
pub const DOM_SELF: usize = 2;
pub const DOM_WINDOW: usize = 2;
pub const DOM_DOCUMENT: usize = 3;
pub const DOM_BODY: usize = 3;

extern "C" {
fn js_register_function(start: usize, len: usize) -> usize;
Expand All @@ -28,7 +29,7 @@ pub struct JSInvoker {
}

impl JSInvoker {
pub fn invoke_0<R>(&self) -> f64
pub fn invoke_0(&self) -> f64
where {
unsafe {
js_invoke_function(
Expand Down

0 comments on commit 6ac3596

Please sign in to comment.