Skip to content

Commit a5a6001

Browse files
committed
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!
1 parent 629a19b commit a5a6001

File tree

1 file changed

+2
-2
lines changed
  • crates/cli-support/src/js

1 file changed

+2
-2
lines changed

crates/cli-support/src/js/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::decode;
22
use crate::descriptor::{Descriptor, VectorKind};
33
use crate::{Bindgen, EncodeInto, OutputMode};
44
use failure::{bail, Error, ResultExt};
5-
use std::collections::{HashMap, HashSet};
5+
use std::collections::{HashMap, HashSet, BTreeMap};
66
use std::env;
77
use walrus::{MemoryId, Module};
88
use wasm_bindgen_wasm_interpreter::Interpreter;
@@ -49,7 +49,7 @@ pub struct Context<'a> {
4949
/// wasm-bindgen emits.
5050
pub direct_imports: HashMap<&'a str, (&'a str, &'a str)>,
5151

52-
pub exported_classes: Option<HashMap<String, ExportedClass>>,
52+
pub exported_classes: Option<BTreeMap<String, ExportedClass>>,
5353
pub function_table_needed: bool,
5454
pub interpreter: &'a mut Interpreter,
5555
pub memory: MemoryId,

0 commit comments

Comments
 (0)