Bug 1198200: eslint gives up on some simple innerHTML assignments
This commit is contained in:
Родитель
9e5f487971
Коммит
c1315eb25b
|
@ -52,7 +52,7 @@ module.exports = function (context) {
|
|||
allowed = false;
|
||||
}
|
||||
} else if (expression.type === "CallExpression") {
|
||||
var funcName = expression.callee.property.name;
|
||||
var funcName = expression.callee.name || expression.callee.property.name;
|
||||
if (VALID_UNWRAPPERS.indexOf(funcName) !== -1) {
|
||||
allowed = true;
|
||||
}
|
||||
|
|
|
@ -215,6 +215,17 @@ eslintTester.run("no-unsafe-innerhtml", rule, {
|
|||
type: "CallExpression"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
// bug https://bugzilla.mozilla.org/show_bug.cgi?id=1198200
|
||||
{
|
||||
code: "title.innerHTML = _('WB_LT_TIPS_S_SEARCH'," +
|
||||
" {value0:engine});",
|
||||
errors: [
|
||||
{
|
||||
message: "Unsafe assignment to innerHTML",
|
||||
type: "AssignmentExpression"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче