fix(moduleStaticRecord): move exportAlls outside of the functor
MODIFY
src/index.js
src/index.js
@@ -47,7 +47,7 @@ const makeModuleTransformer = (babelCore, importer) => {
const modulePlugins = makeModulePlugins(sourceOptions);
const output = babelCore.transformSync(source, {
parserOpts: {
- allowAwaitOutsideFunction: true,
+ // allowAwaitOutsideFunction: true,
plugins: parserPlugins,
},
generatorOpts: {
@@ -135,7 +135,7 @@ const makeModuleTransformer = (babelCore, importer) => {
// The functor captures the SES `arguments`, which is definitely
// less bad than the functor's arguments (which we are trying to
- // hide.
+ // hide).
//
// It must also be strict to enforce strictness of modules.
// We use destructuring parameters, so 'use strict' is not allowed
@@ -143,14 +143,15 @@ const makeModuleTransformer = (babelCore, importer) => {
const functorSource = `\
(async ({ \
imports: ${h.HIDDEN_IMPORTS}, \
- onceVar: ${h.HIDDEN_ONCE}, \
liveVar: ${h.HIDDEN_LIVE}, \
+ onceVar: ${h.HIDDEN_ONCE}, \
}) => { \
${preamble} \
${scriptSource}
})`;
const moduleStaticRecord = {
+ exportAlls: sourceOptions.exportAlls,
imports: sourceOptions.imports,
liveExportMap: sourceOptions.liveExportMap,
fixedExportMap: sourceOptions.fixedExportMap,

MODIFY
test/test-import.js
test/test-import.js
@@ -56,6 +56,7 @@ test('import', async t => {
t.deepEquals(
importNS.staticRecord,
{
+ exportAlls: [],
imports: { module: ['*'] },
liveExportMap: {},
fixedExportMap: {},
@@ -83,6 +84,7 @@ test('import', async t => {
t.deepEquals(
importNames.staticRecord,
{
+ exportAlls: [],
imports: { module: ['foo', 'bar'] },
liveExportMap: {},
fixedExportMap: {},
@@ -104,6 +106,7 @@ test('import', async t => {
t.deepEquals(
importDefault.staticRecord,
{
+ exportAlls: [],
imports: { module: ['default'] },
liveExportMap: {},
fixedExportMap: {},

fix(moduleStaticRecord): move exportAlls outside of the functor