Skip to content

Commit 36997e1

Browse files
committed
Comment out WB's TS definitions using a hack
1 parent 1d5df41 commit 36997e1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

wasm/lib/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ use rustpython_vm::pyobject::{self, PyFuncArgs, PyObjectRef, PyResult};
1111
use rustpython_vm::VirtualMachine;
1212
use wasm_bindgen::{prelude::*, JsCast};
1313

14+
// Hack to comment out wasm-bindgen's typescript definitons
15+
const TS_CMT_START: &'static str = "/*";
16+
1417
fn py_str_err(vm: &mut VirtualMachine, py_err: &PyObjectRef) -> String {
1518
vm.to_pystr(&py_err)
1619
.unwrap_or_else(|_| "Error, and error getting error message".into())
@@ -221,7 +224,8 @@ pub fn eval_py(source: &str, options: Option<Object>) -> Result<JsValue, JsValue
221224
}
222225

223226
#[wasm_bindgen(typescript_custom_section)]
224-
const TYPESCRIPT_APPEND: &'static str = r#"
227+
const TYPESCRIPT_DEFS: &'static str = r#"
228+
*/
225229
interface PyEvalOptions {
226230
stdout: (out: string) => void;
227231
vars: { [key: string]: any };

0 commit comments

Comments
 (0)