Fix(babel-preset-env): check api.caller is a function to avoid… (#10649)

This commit is contained in:
Archer 2019-11-05 21:39:14 +08:00 committed by Nicolò Ribaudo
parent 5f2240e7ab
commit f8eb290da1

View File

@ -237,7 +237,7 @@ export default declare((api, opts) => {
modules !== "auto" || !api.caller || !api.caller(supportsStaticESM),
shouldTransformDynamicImport:
modules !== "auto" || !api.caller || !api.caller(supportsDynamicImport),
shouldParseTopLevelAwait: api.caller(supportsTopLevelAwait),
shouldParseTopLevelAwait: !api.caller || api.caller(supportsTopLevelAwait),
});
const pluginNames = filterItems(