mirror of
https://github.com/actions/labeler
synced 2026-05-12 16:51:09 +02:00
build
This commit is contained in:
72
node_modules/@babel/traverse/lib/path/family.js
generated
vendored
72
node_modules/@babel/traverse/lib/path/family.js
generated
vendored
@@ -20,17 +20,11 @@ exports.getOuterBindingIdentifierPaths = getOuterBindingIdentifierPaths;
|
||||
|
||||
var _index = _interopRequireDefault(require("./index"));
|
||||
|
||||
function t() {
|
||||
const data = _interopRequireWildcard(require("@babel/types"));
|
||||
var t = _interopRequireWildcard(require("@babel/types"));
|
||||
|
||||
t = function () {
|
||||
return data;
|
||||
};
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
|
||||
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; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
@@ -47,6 +41,57 @@ function addCompletionRecords(path, paths) {
|
||||
return paths;
|
||||
}
|
||||
|
||||
function completionRecordForSwitch(cases, paths) {
|
||||
let isLastCaseWithConsequent = true;
|
||||
|
||||
for (let i = cases.length - 1; i >= 0; i--) {
|
||||
const switchCase = cases[i];
|
||||
const consequent = switchCase.get("consequent");
|
||||
let breakStatement;
|
||||
|
||||
findBreak: for (const statement of consequent) {
|
||||
if (statement.isBlockStatement()) {
|
||||
for (const statementInBlock of statement.get("body")) {
|
||||
if (statementInBlock.isBreakStatement()) {
|
||||
breakStatement = statementInBlock;
|
||||
break findBreak;
|
||||
}
|
||||
}
|
||||
} else if (statement.isBreakStatement()) {
|
||||
breakStatement = statement;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (breakStatement) {
|
||||
while (breakStatement.key === 0 && breakStatement.parentPath.isBlockStatement()) {
|
||||
breakStatement = breakStatement.parentPath;
|
||||
}
|
||||
|
||||
const prevSibling = breakStatement.getPrevSibling();
|
||||
|
||||
if (breakStatement.key > 0 && (prevSibling.isExpressionStatement() || prevSibling.isBlockStatement())) {
|
||||
paths = addCompletionRecords(prevSibling, paths);
|
||||
breakStatement.remove();
|
||||
} else {
|
||||
breakStatement.replaceWith(breakStatement.scope.buildUndefinedNode());
|
||||
paths = addCompletionRecords(breakStatement, paths);
|
||||
}
|
||||
} else if (isLastCaseWithConsequent) {
|
||||
const statementFinder = statement => !statement.isBlockStatement() || statement.get("body").some(statementFinder);
|
||||
|
||||
const hasConsequent = consequent.some(statementFinder);
|
||||
|
||||
if (hasConsequent) {
|
||||
paths = addCompletionRecords(consequent[consequent.length - 1], paths);
|
||||
isLastCaseWithConsequent = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
function getCompletionRecords() {
|
||||
let paths = [];
|
||||
|
||||
@@ -62,9 +107,10 @@ function getCompletionRecords() {
|
||||
} else if (this.isTryStatement()) {
|
||||
paths = addCompletionRecords(this.get("block"), paths);
|
||||
paths = addCompletionRecords(this.get("handler"), paths);
|
||||
paths = addCompletionRecords(this.get("finalizer"), paths);
|
||||
} else if (this.isCatchClause()) {
|
||||
paths = addCompletionRecords(this.get("body"), paths);
|
||||
} else if (this.isSwitchStatement()) {
|
||||
paths = completionRecordForSwitch(this.get("cases"), paths);
|
||||
} else {
|
||||
paths.push(this);
|
||||
}
|
||||
@@ -170,11 +216,11 @@ function _getPattern(parts, context) {
|
||||
}
|
||||
|
||||
function getBindingIdentifiers(duplicates) {
|
||||
return t().getBindingIdentifiers(this.node, duplicates);
|
||||
return t.getBindingIdentifiers(this.node, duplicates);
|
||||
}
|
||||
|
||||
function getOuterBindingIdentifiers(duplicates) {
|
||||
return t().getOuterBindingIdentifiers(this.node, duplicates);
|
||||
return t.getOuterBindingIdentifiers(this.node, duplicates);
|
||||
}
|
||||
|
||||
function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
|
||||
@@ -186,7 +232,7 @@ function getBindingIdentifierPaths(duplicates = false, outerOnly = false) {
|
||||
const id = search.shift();
|
||||
if (!id) continue;
|
||||
if (!id.node) continue;
|
||||
const keys = t().getBindingIdentifiers.keys[id.node.type];
|
||||
const keys = t.getBindingIdentifiers.keys[id.node.type];
|
||||
|
||||
if (id.isIdentifier()) {
|
||||
if (duplicates) {
|
||||
|
||||
Reference in New Issue
Block a user