зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1230373
- Fix an issue with eslint-plugin-mozilla not detecting the global scope properly when arrow functions are used. r=mossop
MozReview-Commit-ID: IOCM8Fjl0xQ --HG-- extra : rebase_source : 63face219569f50bdfb00bcd7384f334ec6113c2
This commit is contained in:
Родитель
18a6b40049
Коммит
d4ad271c61
|
@ -10,7 +10,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
var canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
|
let canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
|
||||||
canvas.width = 1000;
|
canvas.width = 1000;
|
||||||
canvas.height = 2000;
|
canvas.height = 2000;
|
||||||
ctx.fillStyle = "red";
|
ctx.fillStyle = "red";
|
||||||
|
|
|
@ -388,7 +388,8 @@ module.exports = {
|
||||||
getIsGlobalScope(ancestors) {
|
getIsGlobalScope(ancestors) {
|
||||||
for (let parent of ancestors) {
|
for (let parent of ancestors) {
|
||||||
if (parent.type == "FunctionExpression" ||
|
if (parent.type == "FunctionExpression" ||
|
||||||
parent.type == "FunctionDeclaration") {
|
parent.type == "FunctionDeclaration" ||
|
||||||
|
parent.type == "ArrowFunctionExpression") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче