refactor(ses)git dc: Break support for runtime export inference
MODIFY
packages/ses/src/module-instance.js
packages/ses/src/module-instance.js
@@ -310,36 +310,23 @@ export const makeModuleInstance = (
for (const [specifier, importUpdaters] of updateRecord.entries()) {
const instance = importedInstances.get(specifier);
instance.execute(); // bottom up cycle tolerant
- const { notifiers: modNotifiers } = instance;
- if (modNotifiers === undefined) {
+ const { notifiers: importNotifiers } = instance;
for (const [importName, updaters] of importUpdaters.entries()) {
- for (const update of updaters) {
- update(instance.exportsProxy[importName]);
- }
- }
- if (exportAlls.includes(specifier)) {
- for (const [importName, value] of entries(instance.exportsProxy)) {
- const notify = update => update(value);
- candidateAll[importName] = notify;
- }
- }
- } else {
- for (const [importName, updaters] of importUpdaters.entries()) {
- const notify = modNotifiers[importName];
- if (!notify) {
+ const importNotify = importNotifiers[importName];
+ if (!importNotify) {
throw SyntaxError(
`The requested module '${specifier}' does not provide an export named '${importName}'`,
);
}
for (const updater of updaters) {
- notify(updater);
+ importNotify(updater);
}
}
if (exportAlls.includes(specifier)) {
// Make all these imports candidates.
- for (const [importName, notify] of entries(modNotifiers)) {
+ for (const [importName, importNotify] of entries(importNotifiers)) {
if (candidateAll[importName] === undefined) {
- candidateAll[importName] = notify;
+ candidateAll[importName] = importNotify;
} else {
// Already a candidate: remove ambiguity.
candidateAll[importName] = false;
@@ -347,7 +334,6 @@ export const makeModuleInstance = (
}
}
}
- }
for (const [importName, notify] of entries(candidateAll)) {
if (!notifiers[importName] && notify !== false) {

refactor(ses)git dc: Break support for runtime export inference