fix(ses): Handle null moduleMap
MODIFY
packages/ses/NEWS.md
packages/ses/NEWS.md
@@ -22,6 +22,7 @@ User-visible changes in SES:
- Relaxes the censorship of `import` and `eval` in programs evaluated
under SES to specifically allow the use of `something.import()` or
`something.eval()` methods.
+- Fix: `new Compartment(null, null, options)` no longer throws.
## Release 0.12.7 (5-April-2021)

MODIFY
packages/ses/src/compartment-shim.js
packages/ses/src/compartment-shim.js
@@ -274,7 +274,7 @@ export const makeCompartmentConstructor = (
// moduleMap can be invalid in ways that cannot be detected in the
// constructor, but these checks allow us to throw early for a better
// developer experience.
- for (const [specifier, aliasNamespace] of entries(moduleMap)) {
+ for (const [specifier, aliasNamespace] of entries(moduleMap || {})) {
if (typeof aliasNamespace === 'string') {
// TODO implement parent module record retrieval.
throw new TypeError(

fix(ses): Handle null moduleMap