From 7c3df66be77df98a46549e72ba4a07d8b06ed6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81abor?= Date: Fri, 7 Oct 2022 14:38:06 +0200 Subject: feat(core): Reorder extension initialization (#16136) --- core/runtime.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/runtime.rs b/core/runtime.rs index 7c70d4366..f6d688186 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -466,14 +466,15 @@ impl JsRuntime { extensions: options.extensions, }; + // Init resources and ops before extensions to make sure they are + // available during the initialization process. + js_runtime.init_extension_ops().unwrap(); // TODO(@AaronO): diff extensions inited in snapshot and those provided // for now we assume that snapshot and extensions always match if !has_startup_snapshot { let realm = js_runtime.global_realm(); js_runtime.init_extension_js(&realm).unwrap(); } - // Init extension ops - js_runtime.init_extension_ops().unwrap(); // Init callbacks (opresolve) let global_realm = js_runtime.global_realm(); js_runtime.init_cbs(&global_realm); -- cgit v1.2.3