From 5957289ef21e16031405d63e52f3ac42967fa40f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 10 Oct 2018 10:30:32 -0700 Subject: [PATCH] Add caveat for `BigInt` and `u64` in browser support Closes #948 --- guide/src/reference/browser-support.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/guide/src/reference/browser-support.md b/guide/src/reference/browser-support.md index e16e782e..1ecc1e36 100644 --- a/guide/src/reference/browser-support.md +++ b/guide/src/reference/browser-support.md @@ -50,6 +50,14 @@ also like to be aware of it! has a [`TextEncoder` polyfill implementation][mdntepi] to get you started as well. +* **BigInt and `u64`** - currently the WebAssembly specification for the web + forbids the usage of 64-bit integers (Rust types `i64` and `u64`) in + exported/imported functions. When using `wasm-bindgen`, however, `u64` is + allowed! The reason for this is that it's translated to the `BigInt` type in + JS. The `BigInt` class, however, is only currently supported in Chrome (as of + the time of this writing) and isn't supported in Firefox or Edge, for + example. + If you find other incompatibilities please report them to us! We'd love to either keep this list up-to-date or fix the underlying bugs :)