endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
829 stars 72 forks source link

chore(compartment-mapper): fix type of internal function #1994

Closed boneskull closed 9 months ago

boneskull commented 9 months ago

This addresses the @ts-ignore found in makeFauxModuleExportsNamespace(), which was renamed from makeFeauxModuleExportsNamespace(), because "féaux" translates to "loyal supporters" and not "fake" or "false" like was presumably intended.

I am not so bold to rename it makeErsatzModuleExportsNamespace(), despite "ersatz" being a wholly superior word to either of the above alternatives.

Anyway, this adds a proper type signature and fixes the return type; the importHook prop of the returned value did not adhere to the definition of ImportHook. Likewise, StaticModuleType demands an exports array.

Given this apparently worked just fine before I changed it, one could argue the types ought to be loosened somewhat.