From f840906943849f5a09981e172d57e84301b77386 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 18 Sep 2021 03:44:53 +0200 Subject: fix(core): prevent multiple main module loading (#12128) This commit fixes a problem where loading and executing multiple modules leads to all of the having "import.meta.main" set to true. Following Rust APIs were deprecated: - deno_core::JsRuntime::load_module - deno_runtime::Worker::execute_module - deno_runtime::WebWorker::execute_module Following Rust APIs were added: - deno_core::JsRuntime::load_main_module - deno_core::JsRuntime::load_side_module - deno_runtime::Worker::execute_main_module - deno_runtime::Worker::execute_side_module - deno_runtime::WebWorker::execute_main_module Trying to load multiple "main" modules into the runtime now results in an error. If user needs to load additional "non-main" modules they should use APIs for "side" module. --- cli/tools/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/tools/test.rs') diff --git a/cli/tools/test.rs b/cli/tools/test.rs index a807bde05..0113f1e38 100644 --- a/cli/tools/test.rs +++ b/cli/tools/test.rs @@ -306,7 +306,7 @@ async fn test_specifier( None }; - worker.execute_module(&test_specifier).await?; + worker.execute_main_module(&test_specifier).await?; worker.js_runtime.execute_script( &located_script_name!(), -- cgit v1.2.3