support for arrow funcion expressions as caller/sanitizers (fixes #7)
* check that expression.callee.property exists * when defining funcName, check that either one of its possible values exist first. left out that it was an OR condition. also check that funcName is valid afterwards
This commit is contained in:
Родитель
cf8039a19a
Коммит
5aebdb0b96
|
@ -70,9 +70,9 @@ module.exports = function (context) {
|
|||
} else {
|
||||
allowed = false;
|
||||
}
|
||||
} else if (expression.type === "CallExpression") {
|
||||
} else if ((expression.type === "CallExpression") && (expression.callee.property || expression.callee.name)) {
|
||||
var funcName = expression.callee.name || expression.callee.property.name;
|
||||
if (VALID_UNWRAPPERS.indexOf(funcName) !== -1) {
|
||||
if ( funcName && VALID_UNWRAPPERS.indexOf(funcName) !== -1) {
|
||||
allowed = true;
|
||||
}
|
||||
} else if (expression.type === "BinaryExpression") {
|
||||
|
|
Загрузка…
Ссылка в новой задаче