This patch takes the entire `wasmer-js` crate and merges it into the
`wasmer` crate.
Inside the `lib/api/src/` directory, there are 2 new directories:
1. a new `sys` directory, which contains the usual `wasmer` crate
implementation,
2. a new directory `js`, which contains the implementation of
`wasmer-js`.
The `Cargo.toml` file is still compatible. The `default` feature
fallbacks to `sys-default`, which enables the `sys` feature. All
features related to compilers or engines or anything else prior this
patch, activates the `sys` feature.
Parallel to that, there is a `js-default` and `js` features.
The `Cargo.toml` file is extensively documented to explain what are
dependencies, dev-dependencies, features and other sections related to
`sys` or to `js`.
There is a bug with `wasm_bindgen_test` where it doesn't compile or
look for tests in `tests/*/<test>.rs`. The hack is to name files
`tests/js_<test>.rs`. Ugly, but it works.
1772: Remove lifetime parameter from `NativeFunc` r=MarkMcCaskey a=MarkMcCaskey
Ran into this as an annoyance on #1739 ; will need to account for this when we fix the memory leak in `InstanceHandle`.
Note: the lifetime wasn't doing anything useful for us, this change doesn't make anything new possible (other than not having to deal with the lifetime parameter)
# Review
- [x] Add a short description of the the change to the CHANGELOG.md file
Co-authored-by: Mark McCaskey <mark@wasmer.io>
Also fix a syntax error, use assert_eq! instead of assert! to compare two values for equality.
Also in passing, convert a comment about something not being done into a TODO.
`NativeFunc::call` is about 8% faster in the case we're benchmarking
by avoiding allocating a vector for the params / returns, instead we
do logic to determine which is larger and use that, conditionally
copying it back to the rets array if needed.