forked from Rust-related/RustPython
formatting fixes
This commit is contained in:
@@ -17,4 +17,4 @@ wasm-bindgen = "0.2"
|
||||
|
||||
|
||||
[profile.release]
|
||||
opt-level = "s"
|
||||
opt-level = "s"
|
||||
|
||||
2
wasm/app/bootstrap.js
vendored
2
wasm/app/bootstrap.js
vendored
@@ -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));
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
<body>
|
||||
<script src="./bootstrap.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -11,4 +11,4 @@ module.exports = {
|
||||
plugins: [
|
||||
new CopyWebpackPlugin(['index.html'])
|
||||
],
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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>
|
||||
@@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user