mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-04-23 13:12:14 +00: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
|
/// Returns whether it's likely we're executing in a browser environment, as
|
||||||
/// opposed to node.js.
|
/// 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 {
|
pub fn is_browser() -> bool {
|
||||||
// Test whether we're in a browser by seeing if the `self` property is
|
// 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
|
// defined on the global object, which should in turn only be true in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user