From a5a600192a2199a516b77ea2d83da67f7dc6f80e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 21 Mar 2019 14:37:44 -0700 Subject: [PATCH] Fix a nondeterministic bug in the JS wrapper emitted We've always wanted this to be the deterministic, but usage of `HashMap` for example can accidentally lead to non-determinism. Looks like one was forgotten and the bindings were nondeterministic by accident as a result! --- crates/cli-support/src/js/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 83c667de..41ee3022 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -2,7 +2,7 @@ use crate::decode; use crate::descriptor::{Descriptor, VectorKind}; use crate::{Bindgen, EncodeInto, OutputMode}; use failure::{bail, Error, ResultExt}; -use std::collections::{HashMap, HashSet}; +use std::collections::{HashMap, HashSet, BTreeMap}; use std::env; use walrus::{MemoryId, Module}; use wasm_bindgen_wasm_interpreter::Interpreter; @@ -49,7 +49,7 @@ pub struct Context<'a> { /// wasm-bindgen emits. pub direct_imports: HashMap<&'a str, (&'a str, &'a str)>, - pub exported_classes: Option>, + pub exported_classes: Option>, pub function_table_needed: bool, pub interpreter: &'a mut Interpreter, pub memory: MemoryId,