use deno_core::Extension;
use deno_core::JsRuntime;
use deno_core::RuntimeOptions;
fn main() {
let my_ext = Extension::builder("my_ext")
.middleware(|op| match op.name {
"op_print" => op.disable(),
_ => op,
})
.build();
let mut runtime = JsRuntime::new(RuntimeOptions {
extensions: vec![my_ext],
..Default::default()
});
runtime
.execute_script("<usage>", r#"Deno.core.print("I'm broken")"#)
.unwrap();
}