formatting fixes

This commit is contained in:
rmliddle
2018-10-28 13:30:18 +11:00
parent 958ee94bdc
commit 27b5796b92
6 changed files with 8 additions and 22 deletions

View File

@@ -17,4 +17,4 @@ wasm-bindgen = "0.2"
[profile.release]
opt-level = "s"
opt-level = "s"

View File

@@ -2,4 +2,4 @@
// asynchronously. This `bootstrap.js` file does the single async import, so
// that no one else needs to worry about it again.
import("./index.js")
.catch(e => console.error("Error importing `index.js`:", e));
.catch(e => console.error("Error importing `index.js`:", e));

View File

@@ -7,4 +7,4 @@
<body>
<script src="./bootstrap.js"></script>
</body>
</html>
</html>

View File

@@ -11,4 +11,4 @@ module.exports = {
plugins: [
new CopyWebpackPlugin(['index.html'])
],
};
};

View File

@@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>RustPython/Wasm</title>
<script>
var Module = {
wasmBinaryFile: "rustpython_wasm.wasm"
}
</script>
<script src="rustpython_wasm.js"></script>
</head>
<body></body>
</html>

View File

@@ -1,8 +1,8 @@
extern crate rustpython_vm;
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
use rustpython_vm::VirtualMachine;
use rustpython_vm::compile;
use rustpython_vm::VirtualMachine;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
@@ -23,6 +23,6 @@ pub fn run_code(source: &str) -> () {
let vars = vm.context().new_scope(Some(builtins));
match vm.run_code_obj(code_obj.unwrap(), vars) {
Ok(_value) => log("Execution successful"),
Err(_) => log("Execution failed")
Err(_) => log("Execution failed"),
}
}
}