Add comment to Emscripten module.

This commit is contained in:
Sergey Pepyakin 2017-11-27 16:14:32 +03:00
parent 0ea8a48a64
commit f532bff101
2 changed files with 6 additions and 3 deletions

View File

@ -59,7 +59,7 @@ fn try_deserialize(base_dir: &str, module_path: &str) -> Result<elements::Module
fn try_load(base_dir: &str, module_path: &str) -> Result<(), InterpreterError> { fn try_load(base_dir: &str, module_path: &str) -> Result<(), InterpreterError> {
let module = try_deserialize(base_dir, module_path).map_err(|e| parity_wasm::interpreter::Error::Program(format!("{:?}", e)))?; let module = try_deserialize(base_dir, module_path).map_err(|e| parity_wasm::interpreter::Error::Program(format!("{:?}", e)))?;
let program = ProgramInstance::new().expect("Failed creating program"); let program = ProgramInstance::new();
program.add_module("try_load", module, None).map(|_| ()) program.add_module("try_load", module, None).map(|_| ())
} }
@ -172,7 +172,7 @@ pub fn spec(name: &str) {
.expect(&format!("Failed to load json file {}", &fixture.json)); .expect(&format!("Failed to load json file {}", &fixture.json));
let spec: test::Spec = serde_json::from_reader(&mut f).expect("Failed to deserialize JSON file"); let spec: test::Spec = serde_json::from_reader(&mut f).expect("Failed to deserialize JSON file");
let program = ProgramInstance::new().expect("Failed creating program"); let program = ProgramInstance::new();
let mut last_module = None; let mut last_module = None;
for command in &spec.commands { for command in &spec.commands {
println!("command {:?}", command); println!("command {:?}", command);

View File

@ -1,3 +1,6 @@
//! This module provides some of the simplest exports
//! from the Emscripten runtime, such as `STACKTOP` or `abort`.
use std::sync::{Arc, Weak}; use std::sync::{Arc, Weak};
use std::collections::HashMap; use std::collections::HashMap;
use builder::module; use builder::module;
@ -27,7 +30,7 @@ const DEFAULT_TABLE_BASE: u32 = 0;
/// Default tableBase variable value. /// Default tableBase variable value.
const DEFAULT_MEMORY_BASE: u32 = 0; const DEFAULT_MEMORY_BASE: u32 = 0;
/// Defaul table size. /// Default table size.
const DEFAULT_TABLE_SIZE: u32 = 64; const DEFAULT_TABLE_SIZE: u32 = 64;
/// Index of default memory. /// Index of default memory.