You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not all of these must make sense, I'm "thinking aloud":
compartmentDescriptors are not changing between calls to importNowHook, so most of this work could be hoisted out to the topmost maker function and only a lookup in a reindexed structure would be needed. On the other hand, the memory needed for that would be wasted most of the time as it's a very rare situation
I'd consider extracting it to a separate function findCompartmentContainingAbsolutePath
since this is not causing a module to be loaded, only redirecting - the further steps are going through a policy check anyway so skipping attenuators compartment in the lookup should be unnecessary as if any attenuators exist, a policy exists as well to prevent their code from being loaded by the compartment.
I'm not sure if this makes sense, but could policy be used to narrow down the search here? Take only the packages allowed by policy and look in their descriptors only.
This concerns the logic in makeImportNowHook, 'round about here:
per @naugtur's comment:
This concerns the logic in
makeImportNowHook
, 'round about here:endo/packages/compartment-mapper/src/import-hook.js
Lines 655 to 667 in 84b4513
The text was updated successfully, but these errors were encountered: