Cleans up the WASM environment handling.

Instead of passing the entire script resolver as a pointer to the WebAssemblyEnv, we now have split off the data actually relevant to the environment into it's own class, which is stored inside of an Arc.
This commit is contained in:
2022-07-18 13:18:11 +02:00
parent 9472c1cec2
commit 0961b199ff
9 changed files with 178 additions and 121 deletions

View File

@@ -28,6 +28,7 @@ pub struct Species {
/// A cached String Key to get the default form.
static DEFAULT_KEY: conquer_once::OnceCell<StringKey> = conquer_once::OnceCell::uninit();
/// Gets the StringKey for "default". Initialises it if it does not exist.
fn get_default_key() -> StringKey {
DEFAULT_KEY.get_or_init(|| StringKey::new("default")).clone()
}