Rename misleading identifier

notRegenerator actually _enabled_ transforming regeneratorRuntime references.
This commit is contained in:
Diogo Franco 2017-12-15 11:20:15 +09:00 committed by GitHub
parent 8a4124b2ff
commit a66845169f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ export default function(api, options) {
useBuiltIns,
useESModules,
} = options;
const notRegenerator = regenerator !== false;
const regeneratorEnabled = regenerator !== false;
const notPolyfillOrDoesUseBuiltIns = polyfill === false || useBuiltIns;
const isPolyfillAndUseBuiltIns = polyfill && useBuiltIns;
const baseHelpersDir = useBuiltIns ? "helpers/builtin" : "helpers";
@ -80,7 +80,7 @@ export default function(api, options) {
visitor: {
ReferencedIdentifier(path) {
const { node, parent, scope } = path;
if (node.name === "regeneratorRuntime" && notRegenerator) {
if (node.name === "regeneratorRuntime" && regeneratorEnabled) {
path.replaceWith(
this.addDefaultImport(
`${this.moduleName}/regenerator`,