Bump eslint-config-babel and fix lint (#5129)
This commit is contained in:
committed by
Daniel Tschinder
parent
2457c8ee14
commit
8c35b320d3
@@ -67,7 +67,7 @@ const memberExpressionOptimisationVisitor = {
|
||||
if (state.noOptimise) {
|
||||
state.deopted = true;
|
||||
} else {
|
||||
const {parentPath} = path;
|
||||
const { parentPath } = path;
|
||||
|
||||
// Is this identifier the right hand side of a default parameter?
|
||||
if (parentPath.listKey === "params" && parentPath.key < state.offset) {
|
||||
@@ -117,13 +117,13 @@ const memberExpressionOptimisationVisitor = {
|
||||
// if we know that this member expression is referencing a number then
|
||||
// we can safely optimise it
|
||||
if (parentPath.get("property").isBaseType("number")) {
|
||||
state.candidates.push({cause: "indexGetter", path});
|
||||
state.candidates.push({ cause: "indexGetter", path });
|
||||
return;
|
||||
}
|
||||
}
|
||||
// args.length
|
||||
else if (parentPath.node.property.name === "length") {
|
||||
state.candidates.push({cause: "lengthGetter", path});
|
||||
state.candidates.push({ cause: "lengthGetter", path });
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -136,7 +136,7 @@ const memberExpressionOptimisationVisitor = {
|
||||
if (state.offset === 0 && parentPath.isSpreadElement()) {
|
||||
const call = parentPath.parentPath;
|
||||
if (call.isCallExpression() && call.node.arguments.length === 1) {
|
||||
state.candidates.push({cause: "argSpread", path});
|
||||
state.candidates.push({ cause: "argSpread", path });
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ function optimiseIndexGetter(path, argsId, offset) {
|
||||
const { scope } = path;
|
||||
if (!scope.isPure(index)) {
|
||||
const temp = scope.generateUidIdentifierBasedOnNode(index);
|
||||
scope.push({id: temp, kind: "var"});
|
||||
scope.push({ id: temp, kind: "var" });
|
||||
path.parentPath.replaceWith(restIndexImpure({
|
||||
ARGUMENTS: argsId,
|
||||
INDEX: index,
|
||||
@@ -246,7 +246,7 @@ export const visitor = {
|
||||
|
||||
// There are only "shorthand" references
|
||||
if (!state.deopted && !state.references.length) {
|
||||
for (const {path, cause} of (state.candidates: Array)) {
|
||||
for (const { path, cause } of (state.candidates: Array)) {
|
||||
switch (cause) {
|
||||
case "indexGetter":
|
||||
optimiseIndexGetter(path, argsId, state.offset);
|
||||
|
||||
Reference in New Issue
Block a user