Skip to content
Prev Previous commit
Next Next commit
Use globalThis to access Crypto
  • Loading branch information
daxpedda committed Dec 8, 2024
commit ec6f28950b94351c3ec5f398ff7dff72971f5e43
2 changes: 1 addition & 1 deletion src/backends/wasm_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ extern "C" {
// Web Crypto API: Crypto interface (https://www.w3.org/TR/WebCryptoAPI/)
type Crypto;
// Holds the global `Crypto` object.
#[wasm_bindgen(thread_local_v2, js_name = crypto)]
#[wasm_bindgen(thread_local_v2, js_namespace = globalThis, js_name = crypto)]
static CRYPTO: Option<Crypto>;
// Crypto.getRandomValues()
#[cfg(not(target_feature = "atomics"))]
Expand Down