mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
don't cache builtins when the target is wasm (wasm declaration order is different from the cached version we make at compile time)
This commit is contained in:
parent
86c86ab41e
commit
51a02b05dc
1 changed files with 14 additions and 8 deletions
|
@ -173,14 +173,20 @@ fn deserialize_help(bytes: &[u8]) -> (Subs, Vec<(Symbol, Variable)>) {
|
|||
fn read_cached_subs() -> MutMap<ModuleId, (Subs, Vec<(Symbol, Variable)>)> {
|
||||
let mut output = MutMap::default();
|
||||
|
||||
// Wasm seems to re-order definitions between build time and runtime, but only in release mode.
|
||||
// That is very strange, but we can solve it separately
|
||||
if !cfg!(target_family = "wasm") {
|
||||
output.insert(ModuleId::BOOL, deserialize_help(BOOL));
|
||||
output.insert(ModuleId::RESULT, deserialize_help(RESULT));
|
||||
output.insert(ModuleId::NUM, deserialize_help(NUM));
|
||||
|
||||
output.insert(ModuleId::LIST, deserialize_help(LIST));
|
||||
output.insert(ModuleId::STR, deserialize_help(STR));
|
||||
output.insert(ModuleId::DICT, deserialize_help(DICT));
|
||||
|
||||
output.insert(ModuleId::SET, deserialize_help(SET));
|
||||
output.insert(ModuleId::BOX, deserialize_help(BOX));
|
||||
output.insert(ModuleId::NUM, deserialize_help(NUM));
|
||||
}
|
||||
|
||||
output
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue