Merge pull request #5 from mozfreddyb/bug-1198200
Bug 1198200: eslint gives up on some simple innerHTML assignments
This commit is contained in:
Коммит
2dfe4eb430
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче