Closed petamoriken closed 3 years ago
It can be done already by stacking modules - your entry point imports a module that invokes lockdown, and then also imports a module that contains the rest of the app. Special syntax isn’t needed.
My understanding is that modules do not have a guaranteed execution order, so special syntax (or defer module eval) is needed, am I wrong?
The execution order is quite strictly defined.
The issue seems to be based on my misunderstanding.
@ljharb Thank you for your help 😊
Since the way to freeze intrinsics is provided as a
lockdown
function, it can only be done after all modules have been executed. This does not protect against the risk of malicious modules being injected.How about introducing a new syntax instead of a function?
Alternatively, Stage 1 Deferring Module Evaluation might help this issue.