mirror of
https://github.com/Azure/setup-helm.git
synced 2025-09-09 13:36:37 +00:00
committed by
GitHub
parent
20d2b4f98d
commit
e4f3964f67
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];
|
||||
}
|
||||
|
Reference in New Issue
Block a user