Rely entirely on sourceType for module vs script differentiation. (#7417)

This commit is contained in:
Logan Smyth
2018-02-27 18:11:13 -08:00
committed by GitHub
parent bf8b25289b
commit ddd40bf5c7
19 changed files with 25 additions and 26 deletions

View File

@@ -98,9 +98,7 @@ export default function(api, options) {
visitor: {
Program: {
exit(path) {
// For now this requires unambiguous rather that just sourceType
// because Babel currently parses all files as sourceType:module.
if (!isModule(path, true /* requireUnambiguous */)) return;
if (!isModule(path)) return;
// Rename the bindings auto-injected into the scope so there is no
// risk of conflict between the bindings.