2772 Commits

Author SHA1 Message Date
Pauan
366ed2308f Adding in docs for intern 2019-07-18 22:40:56 +02:00
Pauan
544ec49e02 Shifting the unsafe responsibility a bit 2019-07-18 22:21:48 +02:00
Pauan
ca15a59ace Changing from uluru to HashMap 2019-07-18 21:51:29 +02:00
Pauan
3177fa9edc Minor doc fix 2019-07-18 21:51:29 +02:00
Pauan
2405fad319 Shifting the unsafety guarantees around 2019-07-18 21:51:29 +02:00
Pauan
c3676bc6f9 Removing unneeded if statement 2019-07-18 21:51:29 +02:00
Pauan
8572255e73 Making uluru optional 2019-07-18 21:51:29 +02:00
Pauan
adf21fe6cb Removing unneeded size argument 2019-07-18 21:51:29 +02:00
Pauan
cc6ec867f7 Fixing compile errors 2019-07-18 21:51:28 +02:00
Pauan
1723e9d024 More simplifications 2019-07-18 21:51:28 +02:00
Pauan
1e4cac9c95 Simplifying the output 2019-07-18 21:51:28 +02:00
Pauan
4e504654d1 Undoing some formatting 2019-07-18 21:51:28 +02:00
Pauan
fd88626e38 Fixing compile errors 2019-07-18 21:51:28 +02:00
Pauan
2ee4c54f00 Changing to use WasmSlice for the caching 2019-07-18 21:51:28 +02:00
Pauan
f7e8e70684 Fixing compile errors 2019-07-18 21:51:28 +02:00
Pauan
f28cfc26fe Fixing some things for the cache 2019-07-18 21:51:28 +02:00
Pauan
0359da2060 Potential fix for OptionIntoWasmAbi? 2019-07-18 21:51:28 +02:00
Pauan
0a61e12bd1 Making interning manual 2019-07-18 21:51:28 +02:00
Pauan
86a8842f24 Changing IntoWasmAbi to use interning 2019-07-18 21:51:28 +02:00
Pauan
6767371ca7 Initial interning implementation 2019-07-18 21:51:28 +02:00
Alex Crichton
2529bb0b17
Merge pull request #1670 from fitzgen/check-for-use-after-move-in-methods
Check for use-after-move in JS glue when `--debug` is enabled again
2019-07-17 10:07:01 -05:00
Nick Fitzgerald
8fd5f4ed6a Check for use-after-move in JS glue when --debug is enabled again
Fixes #1669
2019-07-16 13:35:59 -07:00
Alex Crichton
1807de74a7
Merge pull request #1665 from ia0/getElementsByClassName
Add Element::get_elements_by_class_name
2019-07-15 12:57:18 -05:00
Julien Cretin
170ce683d8 Add missing Element::get_elements_by_* methods 2019-07-15 19:47:09 +02:00
Nick Fitzgerald
a48a0aeb93
Merge pull request #1654 from fitzgen/no-import-shims
Skip generating JS import shims when unnecessary
2019-07-15 10:13:11 -07:00
Nick Fitzgerald
31ca527523 Bump wasm-webidl-bindings dep to 0.1.2 2019-07-15 09:35:22 -07:00
Nick Fitzgerald
afb33e5cf4 Assert that a bunch more function signatures don't require JS glue 2019-07-12 12:34:29 -07:00
Nick Fitzgerald
bce892b625 Add #[wasm_bindgen(assert_no_shim)] on imported functions for testing
This should not be used outside of wasm-bindgen's test suite.
2019-07-12 12:34:29 -07:00
Alex Crichton
13b672aac0
Merge pull request #1661 from alexcrichton/fix-nightly
Fix parsing of `final` on Nightly Rust
2019-07-12 12:45:53 -05:00
Alex Crichton
4f86653e0d Fix parsing of final on Nightly Rust
This fixes an issue also reported to upstream (rust-lang/rust#62628) to
ensure that we parse the `final` attribute as either `r#final` or
`final`, since now the compiler is giving us `r#final` and we were
previously only accepting `final`.

The parsing here was a bit wonky, but this setup ended up working!
2019-07-12 10:05:11 -07:00
Nick Fitzgerald
2d0866da9a cli-support: rustfmt 2019-07-11 15:44:16 -07:00
Nick Fitzgerald
d5d3e46334 cli-support: Skip generating JS shims for imports when unnecessary
After this change, any import that only takes and returns ABI-safe numbers (signed
integers less than 64 bits and unrestricted floating point numbers) will be a
direct import, and will not have a little JS shim in the middle.

We don't have a great mechanism for testing the generated bindings' contents --
as opposed to its behavior -- but I manually verified that everything here does
the Right Thing and doesn't have a JS shim:

```rust
\#[wasm_bindgen]
extern "C" {
    fn trivial();

    fn incoming_i32() -> i32;
    fn incoming_f32() -> f32;
    fn incoming_f64() -> f64;

    fn outgoing_i32(x: i32);
    fn outgoing_f32(y: f32);
    fn outgoing_f64(z: f64);

    fn many(x: i32, y: f32, z: f64) -> i32;
}
```

Furthermore, I verified that when our support for emitting native `anyref` is
enabled, then we do not have a JS shim for the following import, but if it is
disabled, then we do have a JS shim:

```rust
\#[wasm_bindgen]
extern "C" {
    fn works_when_anyref_support_is_enabled(v: JsValue) -> JsValue;
}
```

Fixes #1636.
2019-07-11 15:44:16 -07:00
Nick Fitzgerald
f2a4694c69 cli-support: Fix copy-pasted error message
This error case is for an invalid free function, not an invalid constructor.
2019-07-11 15:44:16 -07:00
Nick Fitzgerald
21fe8dc706 cli-support: Fix typo in comment 2019-07-11 15:44:16 -07:00
Alex Crichton
a3ddd097eb
Merge pull request #1660 from alexcrichton/bump
Bump to 0.2.48
0.2.48
2019-07-11 17:16:57 -05:00
Alex Crichton
5c975592be
Merge pull request #1657 from fitzgen/fix-dyn-warnings
Fix warnings about missing `dyn` on trait objects
2019-07-11 17:11:07 -05:00
Alex Crichton
e596ef596c Bump to 0.2.48 2019-07-11 15:02:39 -07:00
Nick Fitzgerald
6252c7ab78 Fix warnings about missing dyn on trait objects 2019-07-11 13:27:20 -07:00
Alex Crichton
c21c85a7ff
Merge pull request #1655 from rustwasm/dependabot/cargo/weedle-0.10
Update weedle requirement from 0.9 to 0.10
2019-07-11 09:09:33 -05:00
dependabot-preview[bot]
ce40388a7f
Update weedle requirement from 0.9 to 0.10
Updates the requirements on [weedle](https://github.com/rustwasm/weedle) to permit the latest version.
- [Release notes](https://github.com/rustwasm/weedle/releases)
- [Commits](https://github.com/rustwasm/weedle/compare/0.9.0...0.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-07-11 10:07:41 +00:00
Nick Fitzgerald
d02e115fd4
Merge pull request #1650 from alexcrichton/less-csp
Use static accessors if possible to get global object
2019-07-10 09:37:56 -07:00
Alex Crichton
b64f5c0ad8
Merge pull request #1649 from alexcrichton/fix-futures
Update futures implementation to not destroy callbacks
2019-07-10 11:02:43 -05:00
Nick Fitzgerald
15cc4fbb0b
Merge pull request #1652 from fitzgen/fix-some-warnings
Fix some warnings
2019-07-09 13:43:28 -07:00
Nick Fitzgerald
6cb659d5ac Fix warning about dead code when testing on non-wasm32 targets
There are functions that are only used on wasm32 targets, but `cfg`ing them is
more work than just making the modules public, and this is just a testing crate.
2019-07-09 13:17:52 -07:00
Nick Fitzgerald
1ba298548f Fix warning about unnecessary parens in generated code 2019-07-09 13:17:34 -07:00
Alex Crichton
d32b6a916c Update futures implementation to not destroy callbacks
JS engines guarantee that at least one of our `then` callbacks are
invoked, so that means if we destroy them prematurely they're guaranteed
to log an exception to the console! Instead to prevent exceptions from
happening tweak how the completion callbacks for JS futures are managed
and ensure that the closures stay alive until they're invoked later.

Closes #1637
2019-07-09 11:14:26 -07:00
Alex Crichton
0b08bba0c7 Use static accessors if possible to get global object
Previously we always used `Function('return this')` but this triggers
CSP errors since it's basically `eval`. Instead this adds a few
preflight checks to look for objects like `globalThis`, `self`, etc.
Currently we don't have a `#[wasm_bindgen]` function annotation to
import a bare global field like `self`, but we test accesses with
`self.self` and `globalThis.globalThis`, catching errors to handle any
issues.

Closes #1641
2019-07-08 13:28:06 -07:00
Alex Crichton
604c036111
Merge pull request #1645 from derekdreery/fix_futures_0_3_hack
Add in (unsafe and incorrect) impls of Send/Sync that are now required.
2019-07-08 12:04:43 -05:00
Alex Crichton
16fc0596eb
Merge pull request #1646 from ibaryshnikov/explicit-extension
Added explicit extension for imported .wasm file for --target bundler
2019-07-08 10:51:25 -05:00
ibaryshnikov
8f52f10aea added explicit extension for imported .wasm file for --target bundler 2019-07-08 03:50:17 +03:00