mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-11-24 06:33:33 +03:00
Fix test --release
Unfortuantely we need to do some linking trickery to make sure a custom section is correctly pulled in...
This commit is contained in:
parent
a7e9da0a81
commit
8e7238d15f
@ -13,6 +13,11 @@ extern "C" {
|
||||
|
||||
/// Returns whether it's likely we're executing in a browser environment, as
|
||||
/// opposed to node.js.
|
||||
// If this function is inlined then there's no other functions in this module
|
||||
// (which becomes an object file) to actually pull in the custom section listed
|
||||
// above. Force this to never be inlined so if this module is needed its forced
|
||||
// to pull in the descriptor section from `#[wasm_bindgen]` above.
|
||||
#[inline(never)]
|
||||
pub fn is_browser() -> bool {
|
||||
// Test whether we're in a browser by seeing if the `self` property is
|
||||
// defined on the global object, which should in turn only be true in
|
||||
|
Loading…
Reference in New Issue
Block a user