rename NumberLiteral to NumericLiteral and RegexLiteral to RegExpLiteral
This commit is contained in:
@@ -67,7 +67,7 @@ export let visitor = {
|
||||
defNode = buildDefaultParam({
|
||||
VARIABLE_NAME: left,
|
||||
DEFAULT_VALUE: right,
|
||||
ARGUMENT_KEY: t.numberLiteral(i),
|
||||
ARGUMENT_KEY: t.numericLiteral(i),
|
||||
ARGUMENTS: argsIdentifier
|
||||
});
|
||||
} else {
|
||||
@@ -131,7 +131,7 @@ export let visitor = {
|
||||
let param = node.params[i];
|
||||
if (param._isDefaultPlaceholder) continue;
|
||||
|
||||
let declar = buildCutOff(param, argsIdentifier, t.numberLiteral(i));
|
||||
let declar = buildCutOff(param, argsIdentifier, t.numericLiteral(i));
|
||||
declar._blockHoist = node.params.length - i;
|
||||
body.push(declar);
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ function optimiseMemberExpression(parent, offset) {
|
||||
prop.value += offset;
|
||||
prop.raw = String(prop.value);
|
||||
} else { // // UnaryExpression, BinaryExpression
|
||||
newExpr = t.binaryExpression("+", prop, t.numberLiteral(offset));
|
||||
newExpr = t.binaryExpression("+", prop, t.numericLiteral(offset));
|
||||
parent.property = newExpr;
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export let visitor = {
|
||||
rest = scope.generateUidIdentifier("ref");
|
||||
|
||||
let declar = t.variableDeclaration("let", pattern.elements.map(function (elem, index) {
|
||||
let accessExpr = t.memberExpression(rest, t.numberLiteral(index), true);
|
||||
let accessExpr = t.memberExpression(rest, t.numericLiteral(index), true);
|
||||
return t.variableDeclarator(elem, accessExpr);
|
||||
}));
|
||||
node.body.body.unshift(declar);
|
||||
@@ -168,7 +168,7 @@ export let visitor = {
|
||||
|
||||
//
|
||||
|
||||
let start = t.numberLiteral(node.params.length);
|
||||
let start = t.numericLiteral(node.params.length);
|
||||
let key = scope.generateUidIdentifier("key");
|
||||
let len = scope.generateUidIdentifier("len");
|
||||
|
||||
@@ -189,7 +189,7 @@ export let visitor = {
|
||||
arrLen = t.conditionalExpression(
|
||||
t.binaryExpression(">", len, start),
|
||||
t.binaryExpression("-", len, start),
|
||||
t.numberLiteral(0)
|
||||
t.numericLiteral(0)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user