From b28f9445aae85dbf86033300cfcb55e404529a23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 28 Apr 2021 18:28:46 +0200 Subject: refactor(core): simplify module loading code (#10385) General cleanup of module loading code, tried to reduce indentation in various methods on "JsRuntime" to improve readability. Added "JsRuntime::handle_scope" helper function, which returns a "v8::HandleScope". This was done to reduce a code pattern that happens all over the "deno_core". Additionally if event loop hangs during loading of dynamic modules a list of currently pending dynamic imports is printed. --- op_crates/url/benches/url_ops.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'op_crates') diff --git a/op_crates/url/benches/url_ops.rs b/op_crates/url/benches/url_ops.rs index 7d5d32879..0f584de90 100644 --- a/op_crates/url/benches/url_ops.rs +++ b/op_crates/url/benches/url_ops.rs @@ -33,8 +33,7 @@ fn create_js_runtime() -> JsRuntime { pub fn bench_runtime_js(b: &mut Bencher, src: &str) { let mut runtime = create_js_runtime(); - let context = runtime.global_context(); - let scope = &mut v8::HandleScope::with_context(runtime.v8_isolate(), context); + let scope = &mut runtime.handle_scope(); let code = v8::String::new(scope, src).unwrap(); let script = v8::Script::compile(scope, code, None).unwrap(); b.iter(|| { -- cgit v1.2.3