Skip to content

Commit 0445678

Browse files
committed
Merge remote-tracking branch 'upstream/master' into prototype-inheritance
2 parents 17ba75f + a162531 commit 0445678

File tree

50 files changed

+895
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+895
-265
lines changed

CHANGELOG.md

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,81 @@
22

33
--------------------------------------------------------------------------------
44

5-
## Unreleased
5+
## 0.2.50
66

7-
Released YYYY-MM-DD.
7+
Released 2019-08-19.
88

99
### Added
1010

11-
* TODO (or remove section if none)
11+
* Experimental support with a `WASM_INTERFACE_TYPES=1` environment variable has
12+
been added to emit a Wasm Interface Types custom section, making the output of
13+
`wasm-bindgen` a single standalone WebAssembly file.
14+
[#1725](https://github.com/rustwasm/wasm-bindgen/pull/1725)
1215

13-
### Changed
16+
### Fixed
1417

15-
* TODO (or remove section if none)
18+
* Unrelated errors are now no longer accidentally swallowed by the
19+
`instantiateStreaming` fallback.
20+
[#1723](https://github.com/rustwasm/wasm-bindgen/pull/1723)
1621

17-
### Deprecated
22+
--------------------------------------------------------------------------------
1823

19-
* TODO (or remove section if none)
24+
## 0.2.49
2025

21-
### Removed
26+
Released 2019-08-14.
27+
28+
### Added
29+
30+
* Add binding for `Element.getElementsByClassName`.
31+
[#1665](https://github.com/rustwasm/wasm-bindgen/pull/1665)
32+
33+
* `PartialEq` and `Eq` are now implementd for all `web-sys` types.
34+
[#1673](https://github.com/rustwasm/wasm-bindgen/pull/1673)
35+
36+
* The `wasm-bindgen-futures` crate now has support for futures when the
37+
experimental WebAssembly threading feature is enabled.
38+
[#1514](https://github.com/rustwasm/wasm-bindgen/pull/1514)
39+
40+
* A new `enable-interning` feature is available to intern strings and reduce the
41+
cost of transferring strings across the JS/Rust boundary.
42+
[#1612](https://github.com/rustwasm/wasm-bindgen/pull/1612)
43+
44+
* The `wasm-bindgen` CLI has experimental support for reading native
45+
`webidl-bindings` custom sections and generating JS glue. This support is in
46+
addition to Rust's own custom sections and allows using `wasm-bindgen` with
47+
binaries produced by other than rustc possibly.
48+
[#1690](https://github.com/rustwasm/wasm-bindgen/pull/1690)
49+
50+
* New environment variables have been added to configure webdriver startup
51+
arguments.
52+
[#1703](https://github.com/rustwasm/wasm-bindgen/pull/1703)
53+
54+
* New `JsValue::{is_truthy,is_falsy}` methods are now available.
55+
[#1638](https://github.com/rustwasm/wasm-bindgen/pull/1638)
56+
57+
### Changed
58+
59+
* JS import shims are now skipped again when they are unnecessary.
60+
[#1654](https://github.com/rustwasm/wasm-bindgen/pull/1654)
2261

23-
* TODO (or remove section if none)
62+
* WebAssembly output files now directly embed the module/name for imports if
63+
supported for the target and the import, reducing JS shims even further.
64+
[#1689](https://github.com/rustwasm/wasm-bindgen/pull/1689)
2465

2566
### Fixed
2667

27-
* TODO (or remove section if none)
68+
* Support for threads have been updated for LLVM 9 and nightly Rust.
69+
[#1675](https://github.com/rustwasm/wasm-bindgen/pull/1675)
70+
[#1688](https://github.com/rustwasm/wasm-bindgen/pull/1688)
2871

29-
### Security
72+
* The `anyref` passes in `wasm-bindgen` have seen a number of fixes to improve
73+
their correctness and get the full test suite running.
74+
[#1692](https://github.com/rustwasm/wasm-bindgen/pull/1692)
75+
[#1704](https://github.com/rustwasm/wasm-bindgen/pull/1704)
3076

31-
* TODO (or remove section if none)
77+
* Support for `futures-preview 0.3.0-alpha.18` has been added to
78+
`wasm-bindgen-futures`.
79+
[#1716](https://github.com/rustwasm/wasm-bindgen/pull/1716)
3280

3381
--------------------------------------------------------------------------------
3482

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasm-bindgen"
3-
version = "0.2.48"
3+
version = "0.2.50"
44
authors = ["The wasm-bindgen Developers"]
55
license = "MIT/Apache-2.0"
66
readme = "README.md"
@@ -36,14 +36,14 @@ strict-macro = ["wasm-bindgen-macro/strict-macro"]
3636
xxx_debug_only_print_generated_code = ["wasm-bindgen-macro/xxx_debug_only_print_generated_code"]
3737

3838
[dependencies]
39-
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.48" }
39+
wasm-bindgen-macro = { path = "crates/macro", version = "=0.2.50" }
4040
serde = { version = "1.0", optional = true }
4141
serde_json = { version = "1.0", optional = true }
4242
cfg-if = "0.1.9"
4343

4444
[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
45-
js-sys = { path = 'crates/js-sys', version = '0.3.25' }
46-
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.48' }
45+
js-sys = { path = 'crates/js-sys', version = '0.3.27' }
46+
wasm-bindgen-test = { path = 'crates/test', version = '=0.2.50' }
4747
serde_derive = "1.0"
4848
wasm-bindgen-test-crate-a = { path = 'tests/crates/a', version = '0.1' }
4949
wasm-bindgen-test-crate-b = { path = 'tests/crates/b', version = '0.1' }

crates/anyref-xform/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasm-bindgen-anyref-xform"
3-
version = "0.2.48"
3+
version = "0.2.50"
44
authors = ["The wasm-bindgen Developers"]
55
license = "MIT/Apache-2.0"
66
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/anyref-xform"

crates/backend/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasm-bindgen-backend"
3-
version = "0.2.48"
3+
version = "0.2.50"
44
authors = ["The wasm-bindgen Developers"]
55
license = "MIT/Apache-2.0"
66
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/backend"
@@ -22,4 +22,4 @@ log = "0.4"
2222
proc-macro2 = "1.0"
2323
quote = '1.0'
2424
syn = { version = '1.0', features = ['full'] }
25-
wasm-bindgen-shared = { path = "../shared", version = "=0.2.48" }
25+
wasm-bindgen-shared = { path = "../shared", version = "=0.2.50" }

crates/cli-support/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasm-bindgen-cli-support"
3-
version = "0.2.48"
3+
version = "0.2.50"
44
authors = ["The wasm-bindgen Developers"]
55
license = "MIT/Apache-2.0"
66
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli-support"
@@ -19,8 +19,8 @@ rustc-demangle = "0.1.13"
1919
serde_json = "1.0"
2020
tempfile = "3.0"
2121
walrus = "0.11.0"
22-
wasm-bindgen-anyref-xform = { path = '../anyref-xform', version = '=0.2.48' }
23-
wasm-bindgen-shared = { path = "../shared", version = '=0.2.48' }
24-
wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.48' }
25-
wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.48' }
22+
wasm-bindgen-anyref-xform = { path = '../anyref-xform', version = '=0.2.50' }
23+
wasm-bindgen-shared = { path = "../shared", version = '=0.2.50' }
24+
wasm-bindgen-threads-xform = { path = '../threads-xform', version = '=0.2.50' }
25+
wasm-bindgen-wasm-interpreter = { path = "../wasm-interpreter", version = '=0.2.50' }
2626
wasm-webidl-bindings = "0.4.0"

crates/cli-support/src/anyref.rs

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use walrus::Module;
66
use wasm_bindgen_anyref_xform::Context;
77
use wasm_webidl_bindings::ast;
88

9-
pub fn process(module: &mut Module) -> Result<(), Error> {
9+
pub fn process(module: &mut Module, wasm_interface_types: bool) -> Result<(), Error> {
1010
let mut cfg = Context::default();
1111
cfg.prepare(module)?;
1212
let bindings = module
@@ -45,18 +45,24 @@ pub fn process(module: &mut Module) -> Result<(), Error> {
4545

4646
cfg.run(module)?;
4747

48-
// Make sure to export the `anyref` table for the JS bindings since it
49-
// will need to be initialized. If it doesn't exist though then the
50-
// module must not use it, so we skip it.
51-
let table = module.tables.iter().find(|t| match t.kind {
52-
walrus::TableKind::Anyref(_) => true,
53-
_ => false,
54-
});
55-
let table = match table {
56-
Some(t) => t.id(),
57-
None => return Ok(()),
58-
};
59-
module.exports.add("__wbg_anyref_table", table);
48+
// If our output is using WebAssembly interface types then our bindings will
49+
// never use this table, so no need to export it. Otherwise it's highly
50+
// likely in web/JS embeddings this will be used, so make sure we export it
51+
// to avoid it getting gc'd accidentally.
52+
if !wasm_interface_types {
53+
// Make sure to export the `anyref` table for the JS bindings since it
54+
// will need to be initialized. If it doesn't exist though then the
55+
// module must not use it, so we skip it.
56+
let table = module.tables.iter().find(|t| match t.kind {
57+
walrus::TableKind::Anyref(_) => true,
58+
_ => false,
59+
});
60+
let table = match table {
61+
Some(t) => t.id(),
62+
None => return Ok(()),
63+
};
64+
module.exports.add("__wbg_anyref_table", table);
65+
}
6066

6167
// Clean up now-unused intrinsics and shims and such
6268
walrus::passes::gc::run(module);

crates/cli-support/src/intrinsic.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,15 @@ macro_rules! intrinsics {
5050
)*
5151
}
5252
}
53+
54+
/// Returns the symbol name of this intrinsic
55+
pub fn name(&self) -> &'static str {
56+
match self {
57+
$(
58+
Intrinsic::$name => $sym,
59+
)*
60+
}
61+
}
5362
}
5463
};
5564
}

0 commit comments

Comments
 (0)