Skip to content

Commit

Permalink
fix(core/modules): Fix concurrent loading of dynamic imports (#11089)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nayeemrmn authored Jun 29, 2021
1 parent 38a7128 commit c577c27
Show file tree
Hide file tree
Showing 3 changed files with 273 additions and 189 deletions.
4 changes: 3 additions & 1 deletion core/bindings.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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,
Expand Down
Loading

0 comments on commit c577c27

Please sign in to comment.