tc39 / proposal-defer-import-eval

A proposal for introducing a way to defer evaluate of a module
https://tc39.es/proposal-defer-import-eval
MIT License
208 stars 12 forks source link

Possible EvaluateSync Implementation #37

Open guybedford opened 4 months ago

guybedford commented 4 months ago

An alternative to implementing EvaluateSync through promise unwrapping could be to fully clone and specialize the Evaluate() function to synchronous evaluation, possibly with a sync arg for InnerModuleEvaluation.

It's entirely editorial, but thought it worth mentioning while we are thinking about the synchronous models in general if we want to more carefully specify it.

I believe Spidermonkey implements Evaluate() as conditionally returning a promise, which I like as an implementation. Another option might even be to hard-code that although it does complicate spec handling a little conditionally checking promises at call sites.

Alternatively feel free to close, just thought it's worth some discussion since we are introducing this method.