Updating NPM dependencies
This commit is contained in:
104
node_modules/@babel/parser/lib/plugins/estree.js
generated
vendored
104
node_modules/@babel/parser/lib/plugins/estree.js
generated
vendored
@@ -11,6 +11,8 @@ var N = _interopRequireWildcard(require("../types"));
|
||||
|
||||
var _scopeflags = require("../util/scopeflags");
|
||||
|
||||
var _error = require("../parser/error");
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
@@ -45,6 +47,13 @@ var _default = superClass => class extends superClass {
|
||||
return node;
|
||||
}
|
||||
|
||||
estreeParseDecimalLiteral(value) {
|
||||
const decimal = null;
|
||||
const node = this.estreeParseLiteral(decimal);
|
||||
node.decimal = String(node.value || value);
|
||||
return node;
|
||||
}
|
||||
|
||||
estreeParseLiteral(value) {
|
||||
return this.parseLiteral(value, "Literal");
|
||||
}
|
||||
@@ -73,20 +82,8 @@ var _default = superClass => class extends superClass {
|
||||
}
|
||||
}
|
||||
|
||||
checkGetterSetterParams(method) {
|
||||
const prop = method;
|
||||
const paramCount = prop.kind === "get" ? 0 : 1;
|
||||
const start = prop.start;
|
||||
|
||||
if (prop.value.params.length !== paramCount) {
|
||||
if (prop.kind === "get") {
|
||||
this.raise(start, "getter must not have any formal parameters");
|
||||
} else {
|
||||
this.raise(start, "setter must have exactly one formal parameter");
|
||||
}
|
||||
} else if (prop.kind === "set" && prop.value.params[0].type === "RestElement") {
|
||||
this.raise(start, "setter function argument must not be a rest parameter");
|
||||
}
|
||||
getObjectOrClassMethodParams(method) {
|
||||
return method.value.params;
|
||||
}
|
||||
|
||||
checkLVal(expr, bindingType = _scopeflags.BIND_NONE, checkClashes, contextDescription, disallowLetBinding) {
|
||||
@@ -102,29 +99,16 @@ var _default = superClass => class extends superClass {
|
||||
}
|
||||
}
|
||||
|
||||
checkDuplicatedProto(prop, protoRef, refExpressionErrors) {
|
||||
if (prop.type === "SpreadElement" || prop.computed || prop.method || prop.shorthand) {
|
||||
checkProto(prop, isRecord, protoRef, refExpressionErrors) {
|
||||
if (prop.method) {
|
||||
return;
|
||||
}
|
||||
|
||||
const key = prop.key;
|
||||
const name = key.type === "Identifier" ? key.name : String(key.value);
|
||||
|
||||
if (name === "__proto__" && prop.kind === "init") {
|
||||
if (protoRef.used) {
|
||||
if (refExpressionErrors && refExpressionErrors.doubleProto === -1) {
|
||||
refExpressionErrors.doubleProto = key.start;
|
||||
} else {
|
||||
this.raise(key.start, "Redefinition of __proto__ property");
|
||||
}
|
||||
}
|
||||
|
||||
protoRef.used = true;
|
||||
}
|
||||
super.checkProto(prop, isRecord, protoRef, refExpressionErrors);
|
||||
}
|
||||
|
||||
isValidDirective(stmt) {
|
||||
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && (!stmt.expression.extra || !stmt.expression.extra.parenthesized);
|
||||
return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && typeof stmt.expression.value === "string" && !stmt.expression.extra?.parenthesized;
|
||||
}
|
||||
|
||||
stmtToDirective(stmt) {
|
||||
@@ -164,6 +148,9 @@ var _default = superClass => class extends superClass {
|
||||
case _types.types.bigint:
|
||||
return this.estreeParseBigIntLiteral(this.state.value);
|
||||
|
||||
case _types.types.decimal:
|
||||
return this.estreeParseDecimalLiteral(this.state.value);
|
||||
|
||||
case _types.types._null:
|
||||
return this.estreeParseLiteral(null);
|
||||
|
||||
@@ -201,8 +188,8 @@ var _default = superClass => class extends superClass {
|
||||
return this.finishNode(node, type);
|
||||
}
|
||||
|
||||
parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc) {
|
||||
const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, containsEsc);
|
||||
parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor) {
|
||||
const node = super.parseObjectMethod(prop, isGenerator, isAsync, isPattern, isAccessor);
|
||||
|
||||
if (node) {
|
||||
node.type = "Property";
|
||||
@@ -235,9 +222,9 @@ var _default = superClass => class extends superClass {
|
||||
|
||||
toAssignableObjectExpressionProp(prop, isLast) {
|
||||
if (prop.kind === "get" || prop.kind === "set") {
|
||||
throw this.raise(prop.key.start, "Object pattern can't contain getter or setter");
|
||||
throw this.raise(prop.key.start, _error.Errors.PatternHasAccessor);
|
||||
} else if (prop.method) {
|
||||
throw this.raise(prop.key.start, "Object pattern can't contain methods");
|
||||
throw this.raise(prop.key.start, _error.Errors.PatternHasMethod);
|
||||
} else {
|
||||
super.toAssignableObjectExpressionProp(prop, isLast);
|
||||
}
|
||||
@@ -256,12 +243,53 @@ var _default = superClass => class extends superClass {
|
||||
return node;
|
||||
}
|
||||
|
||||
toReferencedListDeep(exprList, isParenthesizedExpr) {
|
||||
if (!exprList) {
|
||||
toReferencedArguments(node) {
|
||||
if (node.type === "ImportExpression") {
|
||||
return;
|
||||
}
|
||||
|
||||
super.toReferencedListDeep(exprList, isParenthesizedExpr);
|
||||
super.toReferencedArguments(node);
|
||||
}
|
||||
|
||||
parseExport(node) {
|
||||
super.parseExport(node);
|
||||
|
||||
switch (node.type) {
|
||||
case "ExportAllDeclaration":
|
||||
node.exported = null;
|
||||
break;
|
||||
|
||||
case "ExportNamedDeclaration":
|
||||
if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
|
||||
node.type = "ExportAllDeclaration";
|
||||
node.exported = node.specifiers[0].exported;
|
||||
delete node.specifiers;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
parseSubscript(base, startPos, startLoc, noCalls, state) {
|
||||
const node = super.parseSubscript(base, startPos, startLoc, noCalls, state);
|
||||
|
||||
if (state.optionalChainMember) {
|
||||
if (node.type === "OptionalMemberExpression" || node.type === "OptionalCallExpression") {
|
||||
node.type = node.type.substring(8);
|
||||
}
|
||||
|
||||
if (state.stop) {
|
||||
const chain = this.startNodeAtNode(node);
|
||||
chain.expression = node;
|
||||
return this.finishNode(chain, "ChainExpression");
|
||||
}
|
||||
} else if (node.type === "MemberExpression" || node.type === "CallExpression") {
|
||||
node.optional = false;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user