From 8e7238d15fe180bcf2a4a7b6c0949ed9b908cd76 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 1 Oct 2018 14:44:21 -0700 Subject: [PATCH] Fix `test --release` Unfortuantely we need to do some linking trickery to make sure a custom section is correctly pulled in... --- crates/test/src/rt/detect.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/test/src/rt/detect.rs b/crates/test/src/rt/detect.rs index 295e7c53d..6f83bae84 100644 --- a/crates/test/src/rt/detect.rs +++ b/crates/test/src/rt/detect.rs @@ -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