mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-31 01:11:06 +00:00
This commit optimizes constructing an instance of `JsValue` which is one of `null`, `undefined`, `true`, or `false`. These are commonly created on the Rust side of things and since there's only a limited set of values we can easily prepopulate the global slab with a few entries and use hardcoded indices to refer to these constants. This should avoid the need to travel into JS to insert a `null` or and `undefined` into the global slab.