зеркало из
1
0
Форкнуть 0

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:
LockeLamora 2016-09-30 12:01:29 +01:00 коммит произвёл Frederik
Родитель cf8039a19a
Коммит 5aebdb0b96
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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") {