diff --git a/src/lib.rs b/src/lib.rs index f38d6a3e2c4..021d8ee930a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -481,6 +481,16 @@ impl JsValue { } } +/// The JsValue type wraps a slab/heap of js objects which is managed by +/// the wasm-bindgen shim, and everything here is not actually able to cross +/// any thread boundaries. When wasm actually has threads, for example, each +/// thread will have to have its own slab of objects generated by +/// wasm-bindgen, and indices in one slab aren't valid in any other slabs. +impl !Send for JsValue {} + +/// Please refer to `!Send` for documentation. +impl !Sync for JsValue {} + impl PartialEq for JsValue { /// Compares two `JsValue`s for equality, using the `===` operator in JS. ///