Classes in JavaScript
The ECMAScript 6 (ES6) introduced classes into the JavaScript. But classes are just a syntactic sugar over the pro...
For further actions, you may consider blocking this person and/or reporting abuse
Thanks for the tutorial :)
However, for the second example you missed the two steps with the building process -
cargo build .....
andwasm-bindgen .......
.(Also - on wasm-bindgen command it complained with my package.json I copied form previous example. So I created a new package.json with only "dependencies" in it, ran the wasm-bindgen command and after that I copied the actual package.json from the previous example. That's how it worked.)
...
But what was most frustrating to me was that I got errors when I tried to compile - it didn't want to load the
point.js
file. It started working for me when I modified it like this:#[wasm_bindgen(module = "/point.js")]
Absolute path & adding extension.
(Probably it's because of the wasm-bindgen version - 0.2.58 on my machine.
... I don't know.)
Anyway, thanks for the tutorial once again ... it's very useful ;)
Yeah I think there is a bug in the
wasm-bindgen
. Currently this should be manually amended in the generated JS file.same here:
relative module paths aren't supported yet
this worked:
#[wasm_bindgen(module = "point.js")]
Finally someone who doesn't just post the add(a, b) example and concludes WASM is easy. Thanks a lot for this three part post.
Thanks Will definitely add some more :)