Rename misleading identifier
notRegenerator actually _enabled_ transforming regeneratorRuntime references.
This commit is contained in:
parent
8a4124b2ff
commit
a66845169f
@ -12,7 +12,7 @@ export default function(api, options) {
|
|||||||
useBuiltIns,
|
useBuiltIns,
|
||||||
useESModules,
|
useESModules,
|
||||||
} = options;
|
} = options;
|
||||||
const notRegenerator = regenerator !== false;
|
const regeneratorEnabled = regenerator !== false;
|
||||||
const notPolyfillOrDoesUseBuiltIns = polyfill === false || useBuiltIns;
|
const notPolyfillOrDoesUseBuiltIns = polyfill === false || useBuiltIns;
|
||||||
const isPolyfillAndUseBuiltIns = polyfill && useBuiltIns;
|
const isPolyfillAndUseBuiltIns = polyfill && useBuiltIns;
|
||||||
const baseHelpersDir = useBuiltIns ? "helpers/builtin" : "helpers";
|
const baseHelpersDir = useBuiltIns ? "helpers/builtin" : "helpers";
|
||||||
@ -80,7 +80,7 @@ export default function(api, options) {
|
|||||||
visitor: {
|
visitor: {
|
||||||
ReferencedIdentifier(path) {
|
ReferencedIdentifier(path) {
|
||||||
const { node, parent, scope } = path;
|
const { node, parent, scope } = path;
|
||||||
if (node.name === "regeneratorRuntime" && notRegenerator) {
|
if (node.name === "regeneratorRuntime" && regeneratorEnabled) {
|
||||||
path.replaceWith(
|
path.replaceWith(
|
||||||
this.addDefaultImport(
|
this.addDefaultImport(
|
||||||
`${this.moduleName}/regenerator`,
|
`${this.moduleName}/regenerator`,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user