use add_dynamically_generated_module in get_or_insert_local_code_index
This commit is contained in:
@@ -559,25 +559,20 @@ impl<'a> LoadState<'a> {
|
|||||||
.or_insert_with(|| CodeIndex::new(IndexPtr::Undefined))
|
.or_insert_with(|| CodeIndex::new(IndexPtr::Undefined))
|
||||||
.clone(),
|
.clone(),
|
||||||
None => {
|
None => {
|
||||||
let mut module = Module::new(
|
self.add_dynamically_generated_module(&module_name);
|
||||||
ModuleDecl {
|
|
||||||
name: module_name.clone(),
|
|
||||||
exports: vec![],
|
|
||||||
},
|
|
||||||
ListingSource::DynamicallyGenerated,
|
|
||||||
);
|
|
||||||
|
|
||||||
let code_index = module
|
match self.wam.indices.modules.get_mut(&module_name) {
|
||||||
|
Some(ref mut module) => {
|
||||||
|
module
|
||||||
.code_dir
|
.code_dir
|
||||||
.entry(key)
|
.entry(key)
|
||||||
.or_insert_with(|| CodeIndex::new(IndexPtr::Undefined))
|
.or_insert_with(|| CodeIndex::new(IndexPtr::Undefined))
|
||||||
.clone();
|
.clone()
|
||||||
|
}
|
||||||
self.retraction_info
|
None => {
|
||||||
.push_record(RetractionRecord::AddedModule(module_name.clone()));
|
unreachable!()
|
||||||
|
}
|
||||||
self.wam.indices.modules.insert(module_name, module);
|
}
|
||||||
code_index
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user