Merge pull request #1383 from alexcrichton/deterministic

Fix a nondeterministic bug in the JS wrapper emitted
This commit is contained in:
Alex Crichton 2019-03-21 16:54:53 -05:00 committed by GitHub
commit a4736682d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,7 @@ use crate::decode;
use crate::descriptor::{Descriptor, VectorKind}; use crate::descriptor::{Descriptor, VectorKind};
use crate::{Bindgen, EncodeInto, OutputMode}; use crate::{Bindgen, EncodeInto, OutputMode};
use failure::{bail, Error, ResultExt}; use failure::{bail, Error, ResultExt};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet, BTreeMap};
use std::env; use std::env;
use walrus::{MemoryId, Module}; use walrus::{MemoryId, Module};
use wasm_bindgen_wasm_interpreter::Interpreter; use wasm_bindgen_wasm_interpreter::Interpreter;
@ -49,7 +49,7 @@ pub struct Context<'a> {
/// wasm-bindgen emits. /// wasm-bindgen emits.
pub direct_imports: HashMap<&'a str, (&'a str, &'a str)>, pub direct_imports: HashMap<&'a str, (&'a str, &'a str)>,
pub exported_classes: Option<HashMap<String, ExportedClass>>, pub exported_classes: Option<BTreeMap<String, ExportedClass>>,
pub function_table_needed: bool, pub function_table_needed: bool,
pub interpreter: &'a mut Interpreter, pub interpreter: &'a mut Interpreter,
pub memory: MemoryId, pub memory: MemoryId,