mirror of
https://github.com/Azure/setup-helm.git
synced 2025-09-10 14:06:39 +00:00
committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
11
node_modules/@babel/traverse/lib/path/context.js
generated
vendored
11
node_modules/@babel/traverse/lib/path/context.js
generated
vendored
@ -129,7 +129,11 @@ function stop() {
|
||||
function setScope() {
|
||||
if (this.opts && this.opts.noScope) return;
|
||||
let path = this.parentPath;
|
||||
if (this.key === "key" && path.isMethod()) path = path.parentPath;
|
||||
|
||||
if ((this.key === "key" || this.listKey === "decorators") && path.isMethod()) {
|
||||
path = path.parentPath;
|
||||
}
|
||||
|
||||
let target;
|
||||
|
||||
while (path && !target) {
|
||||
@ -177,7 +181,10 @@ function _resyncParent() {
|
||||
|
||||
function _resyncKey() {
|
||||
if (!this.container) return;
|
||||
if (this.node === this.container[this.key]) return;
|
||||
|
||||
if (this.node === this.container[this.key]) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Array.isArray(this.container)) {
|
||||
for (let i = 0; i < this.container.length; i++) {
|
||||
|
13
node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
13
node_modules/@babel/traverse/lib/path/conversion.js
generated
vendored
@ -251,10 +251,11 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
|
||||
const flatSuperProps = superProps.reduce((acc, superProp) => acc.concat(standardizeSuperProperty(superProp)), []);
|
||||
flatSuperProps.forEach(superProp => {
|
||||
const key = superProp.node.computed ? "" : superProp.get("property").node.name;
|
||||
const isAssignment = superProp.parentPath.isAssignmentExpression({
|
||||
const superParentPath = superProp.parentPath;
|
||||
const isAssignment = superParentPath.isAssignmentExpression({
|
||||
left: superProp.node
|
||||
});
|
||||
const isCall = superProp.parentPath.isCallExpression({
|
||||
const isCall = superParentPath.isCallExpression({
|
||||
callee: superProp.node
|
||||
});
|
||||
const superBinding = getSuperPropBinding(thisEnvFn, isAssignment, key);
|
||||
@ -265,18 +266,18 @@ function hoistFunctionEnvironment(fnPath, noNewArrows = true, allowInsertArrow =
|
||||
}
|
||||
|
||||
if (isAssignment) {
|
||||
const value = superProp.parentPath.node.right;
|
||||
const value = superParentPath.node.right;
|
||||
args.push(value);
|
||||
}
|
||||
|
||||
const call = callExpression(identifier(superBinding), args);
|
||||
|
||||
if (isCall) {
|
||||
superProp.parentPath.unshiftContainer("arguments", thisExpression());
|
||||
superParentPath.unshiftContainer("arguments", thisExpression());
|
||||
superProp.replaceWith(memberExpression(call, identifier("call")));
|
||||
thisPaths.push(superProp.parentPath.get("arguments.0"));
|
||||
thisPaths.push(superParentPath.get("arguments.0"));
|
||||
} else if (isAssignment) {
|
||||
superProp.parentPath.replaceWith(call);
|
||||
superParentPath.replaceWith(call);
|
||||
} else {
|
||||
superProp.replaceWith(call);
|
||||
}
|
||||
|
12
node_modules/@babel/traverse/lib/path/evaluation.js
generated
vendored
12
node_modules/@babel/traverse/lib/path/evaluation.js
generated
vendored
@ -8,6 +8,14 @@ exports.evaluateTruthy = evaluateTruthy;
|
||||
const VALID_CALLEES = ["String", "Number", "Math"];
|
||||
const INVALID_METHODS = ["random"];
|
||||
|
||||
function isValidCallee(val) {
|
||||
return VALID_CALLEES.includes(val);
|
||||
}
|
||||
|
||||
function isInvalidMethod(val) {
|
||||
return INVALID_METHODS.includes(val);
|
||||
}
|
||||
|
||||
function evaluateTruthy() {
|
||||
const res = this.evaluate();
|
||||
if (res.confident) return !!res.value;
|
||||
@ -336,7 +344,7 @@ function _evaluate(path, state) {
|
||||
let context;
|
||||
let func;
|
||||
|
||||
if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name) && VALID_CALLEES.indexOf(callee.node.name) >= 0) {
|
||||
if (callee.isIdentifier() && !path.scope.getBinding(callee.node.name) && isValidCallee(callee.node.name)) {
|
||||
func = global[callee.node.name];
|
||||
}
|
||||
|
||||
@ -344,7 +352,7 @@ function _evaluate(path, state) {
|
||||
const object = callee.get("object");
|
||||
const property = callee.get("property");
|
||||
|
||||
if (object.isIdentifier() && property.isIdentifier() && VALID_CALLEES.indexOf(object.node.name) >= 0 && INVALID_METHODS.indexOf(property.node.name) < 0) {
|
||||
if (object.isIdentifier() && property.isIdentifier() && isValidCallee(object.node.name) && !isInvalidMethod(property.node.name)) {
|
||||
context = global[object.node.name];
|
||||
func = context[property.node.name];
|
||||
}
|
||||
|
7
node_modules/@babel/traverse/lib/path/index.js
generated
vendored
7
node_modules/@babel/traverse/lib/path/index.js
generated
vendored
@ -135,6 +135,10 @@ class NodePath {
|
||||
return val;
|
||||
}
|
||||
|
||||
hasNode() {
|
||||
return this.node != null;
|
||||
}
|
||||
|
||||
buildCodeFrameError(msg, Error = SyntaxError) {
|
||||
return this.hub.buildError(this.node, msg, Error);
|
||||
}
|
||||
@ -223,6 +227,9 @@ class NodePath {
|
||||
}
|
||||
|
||||
Object.assign(NodePath.prototype, NodePath_ancestry, NodePath_inference, NodePath_replacement, NodePath_evaluation, NodePath_conversion, NodePath_introspection, NodePath_context, NodePath_removal, NodePath_modification, NodePath_family, NodePath_comments);
|
||||
{
|
||||
NodePath.prototype._guessExecutionStatusRelativeToDifferentFunctions = NodePath_introspection._guessExecutionStatusRelativeTo;
|
||||
}
|
||||
|
||||
for (const type of t.TYPES) {
|
||||
const typeKey = `is${type}`;
|
||||
|
12
node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
12
node_modules/@babel/traverse/lib/path/inference/index.js
generated
vendored
@ -33,10 +33,16 @@ const {
|
||||
} = _t;
|
||||
|
||||
function getTypeAnnotation() {
|
||||
if (this.typeAnnotation) return this.typeAnnotation;
|
||||
let type = this._getTypeAnnotation() || anyTypeAnnotation();
|
||||
let type = this.getData("typeAnnotation");
|
||||
|
||||
if (type != null) {
|
||||
return type;
|
||||
}
|
||||
|
||||
type = this._getTypeAnnotation() || anyTypeAnnotation();
|
||||
if (isTypeAnnotation(type)) type = type.typeAnnotation;
|
||||
return this.typeAnnotation = type;
|
||||
this.setData("typeAnnotation", type);
|
||||
return type;
|
||||
}
|
||||
|
||||
const typeAnnotationInferringNodes = new WeakSet();
|
||||
|
2
node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
2
node_modules/@babel/traverse/lib/path/inference/inferer-reference.js
generated
vendored
@ -202,5 +202,5 @@ function getConditionalAnnotation(binding, path, name) {
|
||||
};
|
||||
}
|
||||
|
||||
return getConditionalAnnotation(ifStatement, name);
|
||||
return getConditionalAnnotation(binding, ifStatement, name);
|
||||
}
|
2
node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
2
node_modules/@babel/traverse/lib/path/inference/inferers.js
generated
vendored
@ -87,7 +87,7 @@ function TypeCastExpression(node) {
|
||||
TypeCastExpression.validParent = true;
|
||||
|
||||
function NewExpression(node) {
|
||||
if (this.get("callee").isIdentifier()) {
|
||||
if (node.callee.type === "Identifier") {
|
||||
return genericTypeAnnotation(node.callee);
|
||||
}
|
||||
}
|
||||
|
59
node_modules/@babel/traverse/lib/path/introspection.js
generated
vendored
59
node_modules/@babel/traverse/lib/path/introspection.js
generated
vendored
@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports._guessExecutionStatusRelativeTo = _guessExecutionStatusRelativeTo;
|
||||
exports._guessExecutionStatusRelativeToDifferentFunctions = _guessExecutionStatusRelativeToDifferentFunctions;
|
||||
exports._resolve = _resolve;
|
||||
exports.canHaveVariableDeclarationOrExpression = canHaveVariableDeclarationOrExpression;
|
||||
exports.canSwapBetweenExpressionAndStatement = canSwapBetweenExpressionAndStatement;
|
||||
@ -94,9 +93,12 @@ function isCompletionRecord(allowInsideFunction) {
|
||||
let first = true;
|
||||
|
||||
do {
|
||||
const container = path.container;
|
||||
const {
|
||||
type,
|
||||
container
|
||||
} = path;
|
||||
|
||||
if (path.isFunction() && !first) {
|
||||
if (!first && (path.isFunction() || type === "StaticBlock")) {
|
||||
return !!allowInsideFunction;
|
||||
}
|
||||
|
||||
@ -105,7 +107,7 @@ function isCompletionRecord(allowInsideFunction) {
|
||||
if (Array.isArray(container) && path.key !== container.length - 1) {
|
||||
return false;
|
||||
}
|
||||
} while ((path = path.parentPath) && !path.isProgram());
|
||||
} while ((path = path.parentPath) && !path.isProgram() && !path.isDoExpression());
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -120,7 +122,7 @@ function isStatementOrBlock() {
|
||||
|
||||
function referencesImport(moduleSource, importName) {
|
||||
if (!this.isReferencedIdentifier()) {
|
||||
if ((this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, {
|
||||
if (this.isJSXMemberExpression() && this.node.property.name === importName || (this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, {
|
||||
value: importName
|
||||
}) : this.node.property.name === importName)) {
|
||||
const object = this.get("object");
|
||||
@ -229,20 +231,24 @@ function isExecutionUncertainInList(paths, maxIndex) {
|
||||
}
|
||||
|
||||
function _guessExecutionStatusRelativeTo(target) {
|
||||
return _guessExecutionStatusRelativeToCached(this, target, new Map());
|
||||
}
|
||||
|
||||
function _guessExecutionStatusRelativeToCached(base, target, cache) {
|
||||
const funcParent = {
|
||||
this: getOuterFunction(this),
|
||||
this: getOuterFunction(base),
|
||||
target: getOuterFunction(target)
|
||||
};
|
||||
|
||||
if (funcParent.target.node !== funcParent.this.node) {
|
||||
return this._guessExecutionStatusRelativeToDifferentFunctions(funcParent.target);
|
||||
return _guessExecutionStatusRelativeToDifferentFunctionsCached(base, funcParent.target, cache);
|
||||
}
|
||||
|
||||
const paths = {
|
||||
target: target.getAncestry(),
|
||||
this: this.getAncestry()
|
||||
this: base.getAncestry()
|
||||
};
|
||||
if (paths.target.indexOf(this) >= 0) return "after";
|
||||
if (paths.target.indexOf(base) >= 0) return "after";
|
||||
if (paths.this.indexOf(target) >= 0) return "before";
|
||||
let commonPath;
|
||||
const commonIndex = {
|
||||
@ -286,9 +292,9 @@ function _guessExecutionStatusRelativeTo(target) {
|
||||
return keyPosition.target > keyPosition.this ? "before" : "after";
|
||||
}
|
||||
|
||||
const executionOrderCheckedNodes = new WeakSet();
|
||||
const executionOrderCheckedNodes = new Set();
|
||||
|
||||
function _guessExecutionStatusRelativeToDifferentFunctions(target) {
|
||||
function _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache) {
|
||||
if (!target.isFunctionDeclaration() || target.parentPath.isExportDeclaration()) {
|
||||
return "unknown";
|
||||
}
|
||||
@ -309,20 +315,37 @@ function _guessExecutionStatusRelativeToDifferentFunctions(target) {
|
||||
if (executionOrderCheckedNodes.has(path.node)) continue;
|
||||
executionOrderCheckedNodes.add(path.node);
|
||||
|
||||
const status = this._guessExecutionStatusRelativeTo(path);
|
||||
try {
|
||||
const status = _guessExecutionStatusRelativeToCached(base, path, cache);
|
||||
|
||||
executionOrderCheckedNodes.delete(path.node);
|
||||
|
||||
if (allStatus && allStatus !== status) {
|
||||
return "unknown";
|
||||
} else {
|
||||
allStatus = status;
|
||||
if (allStatus && allStatus !== status) {
|
||||
return "unknown";
|
||||
} else {
|
||||
allStatus = status;
|
||||
}
|
||||
} finally {
|
||||
executionOrderCheckedNodes.delete(path.node);
|
||||
}
|
||||
}
|
||||
|
||||
return allStatus;
|
||||
}
|
||||
|
||||
function _guessExecutionStatusRelativeToDifferentFunctionsCached(base, target, cache) {
|
||||
let nodeMap = cache.get(base.node);
|
||||
|
||||
if (!nodeMap) {
|
||||
cache.set(base.node, nodeMap = new Map());
|
||||
} else if (nodeMap.has(target.node)) {
|
||||
return nodeMap.get(target.node);
|
||||
}
|
||||
|
||||
const result = _guessExecutionStatusRelativeToDifferentFunctionsInternal(base, target, cache);
|
||||
|
||||
nodeMap.set(target.node, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
function resolve(dangerous, resolved) {
|
||||
return this._resolve(dangerous, resolved) || this;
|
||||
}
|
||||
|
3
node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
generated
vendored
3
node_modules/@babel/traverse/lib/path/lib/removal-hooks.js
generated
vendored
@ -4,6 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.hooks = void 0;
|
||||
|
||||
var _ = require("..");
|
||||
|
||||
const hooks = [function (self, parent) {
|
||||
const removeParent = self.key === "test" && (parent.isWhile() || parent.isSwitchCase()) || self.key === "declaration" && parent.isExportDeclaration() || self.key === "body" && parent.isLabeledStatement() || self.listKey === "declarations" && parent.isVariableDeclaration() && parent.node.declarations.length === 1 || self.key === "expression" && parent.isExpressionStatement();
|
||||
|
||||
|
4
node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
4
node_modules/@babel/traverse/lib/path/lib/virtual-types.js
generated
vendored
@ -164,8 +164,8 @@ const Generated = {
|
||||
};
|
||||
exports.Generated = Generated;
|
||||
const Pure = {
|
||||
checkPath(path, opts) {
|
||||
return path.scope.isPure(path.node, opts);
|
||||
checkPath(path, constantsOnly) {
|
||||
return path.scope.isPure(path.node, constantsOnly);
|
||||
}
|
||||
|
||||
};
|
||||
|
57
node_modules/@babel/traverse/lib/path/modification.js
generated
vendored
57
node_modules/@babel/traverse/lib/path/modification.js
generated
vendored
@ -30,7 +30,13 @@ const {
|
||||
callExpression,
|
||||
cloneNode,
|
||||
expressionStatement,
|
||||
isExpression
|
||||
isAssignmentExpression,
|
||||
isCallExpression,
|
||||
isExpression,
|
||||
isIdentifier,
|
||||
isSequenceExpression,
|
||||
isSuper,
|
||||
thisExpression
|
||||
} = _t;
|
||||
|
||||
function insertBefore(nodes_) {
|
||||
@ -96,9 +102,28 @@ function _containerInsertAfter(nodes) {
|
||||
return this._containerInsert(this.key + 1, nodes);
|
||||
}
|
||||
|
||||
const last = arr => arr[arr.length - 1];
|
||||
|
||||
function isHiddenInSequenceExpression(path) {
|
||||
return isSequenceExpression(path.parent) && (last(path.parent.expressions) !== path.node || isHiddenInSequenceExpression(path.parentPath));
|
||||
}
|
||||
|
||||
function isAlmostConstantAssignment(node, scope) {
|
||||
if (!isAssignmentExpression(node) || !isIdentifier(node.left)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const blockScope = scope.getBlockParent();
|
||||
return blockScope.hasOwnBinding(node.left.name) && blockScope.getOwnBinding(node.left.name).constantViolations.length <= 1;
|
||||
}
|
||||
|
||||
function insertAfter(nodes_) {
|
||||
this._assertUnremoved();
|
||||
|
||||
if (this.isSequenceExpression()) {
|
||||
return last(this.get("expressions")).insertAfter(nodes_);
|
||||
}
|
||||
|
||||
const nodes = this._verifyNodeList(nodes_);
|
||||
|
||||
const {
|
||||
@ -123,16 +148,28 @@ function insertAfter(nodes_) {
|
||||
return [this];
|
||||
}
|
||||
|
||||
if (parentPath.isMethod({
|
||||
computed: true,
|
||||
key: node
|
||||
})) {
|
||||
scope = scope.parent;
|
||||
}
|
||||
if (isHiddenInSequenceExpression(this)) {
|
||||
nodes.unshift(node);
|
||||
} else if (isCallExpression(node) && isSuper(node.callee)) {
|
||||
nodes.unshift(node);
|
||||
nodes.push(thisExpression());
|
||||
} else if (isAlmostConstantAssignment(node, scope)) {
|
||||
nodes.unshift(node);
|
||||
nodes.push(cloneNode(node.left));
|
||||
} else if (scope.isPure(node, true)) {
|
||||
nodes.push(node);
|
||||
} else {
|
||||
if (parentPath.isMethod({
|
||||
computed: true,
|
||||
key: node
|
||||
})) {
|
||||
scope = scope.parent;
|
||||
}
|
||||
|
||||
const temp = scope.generateDeclaredUidIdentifier();
|
||||
nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node)));
|
||||
nodes.push(expressionStatement(cloneNode(temp)));
|
||||
const temp = scope.generateDeclaredUidIdentifier();
|
||||
nodes.unshift(expressionStatement(assignmentExpression("=", cloneNode(temp), node)));
|
||||
nodes.push(expressionStatement(cloneNode(temp)));
|
||||
}
|
||||
}
|
||||
|
||||
return this.replaceExpressionWithStatements(nodes);
|
||||
|
15
node_modules/@babel/traverse/lib/path/replacement.js
generated
vendored
15
node_modules/@babel/traverse/lib/path/replacement.js
generated
vendored
@ -69,10 +69,11 @@ function replaceWithMultiple(nodes) {
|
||||
|
||||
function replaceWithSourceString(replacement) {
|
||||
this.resync();
|
||||
let ast;
|
||||
|
||||
try {
|
||||
replacement = `(${replacement})`;
|
||||
replacement = (0, _parser.parse)(replacement);
|
||||
ast = (0, _parser.parse)(replacement);
|
||||
} catch (err) {
|
||||
const loc = err.loc;
|
||||
|
||||
@ -89,23 +90,21 @@ function replaceWithSourceString(replacement) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
replacement = replacement.program.body[0].expression;
|
||||
const expressionAST = ast.program.body[0].expression;
|
||||
|
||||
_index.default.removeProperties(replacement);
|
||||
_index.default.removeProperties(expressionAST);
|
||||
|
||||
return this.replaceWith(replacement);
|
||||
return this.replaceWith(expressionAST);
|
||||
}
|
||||
|
||||
function replaceWith(replacement) {
|
||||
function replaceWith(replacementPath) {
|
||||
this.resync();
|
||||
|
||||
if (this.removed) {
|
||||
throw new Error("You can't replace this node, we've already removed it");
|
||||
}
|
||||
|
||||
if (replacement instanceof _index2.default) {
|
||||
replacement = replacement.node;
|
||||
}
|
||||
let replacement = replacementPath instanceof _index2.default ? replacementPath.node : replacementPath;
|
||||
|
||||
if (!replacement) {
|
||||
throw new Error("You passed `path.replaceWith()` a falsy node, use `path.remove()` instead");
|
||||
|
Reference in New Issue
Block a user