summaryrefslogtreecommitdiff
path: root/core/bindings.rs
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2021-06-29 02:03:02 +0100
committerGitHub <noreply@github.com>2021-06-29 03:03:02 +0200
commitc577c273a467123851be5ce3b0bba1095e6cd621 (patch)
tree4773abfef6f56fd72d2cec6fafaf3b89fa34e8f9 /core/bindings.rs
parent38a7128cdd6f3308ba3c13cfb0b0d4ef925a44c3 (diff)
fix(core/modules): Fix concurrent loading of dynamic imports (#11089)
This commit changes implementation of module loading in "deno_core" to track all currently fetched modules across all existing module loads. In effect a bug that caused concurrent dynamic imports referencing the same module to fail is fixed.
Diffstat (limited to 'core/bindings.rs')
-rw-r--r--core/bindings.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/bindings.rs b/core/bindings.rs
index fd683b3ba..bee3ecf6d 100644
--- a/core/bindings.rs
+++ b/core/bindings.rs
@@ -1,6 +1,7 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::error::AnyError;
+use crate::modules::ModuleMap;
use crate::resolve_url_or_path;
use crate::JsRuntime;
use crate::Op;
@@ -196,7 +197,8 @@ pub extern "C" fn host_import_module_dynamically_callback(
"dyn_import specifier {} referrer {} ",
specifier_str, referrer_name_str
);
- module_map_rc.borrow_mut().load_dynamic_import(
+ ModuleMap::load_dynamic_import(
+ module_map_rc,
&specifier_str,
&referrer_name_str,
resolver_handle,