You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even my IDE was confused by this and we both thought (upon first glance) that the line 137 was shadowing the one on 135 but that was not the case since this project is using "var" instead of "let".
Since the var keyword hoists the declaration to the top of the function, the line 137 does not in fact shadow the previous one, but that is very confusing when reading the code.
I think that the easiest fix would be to simply remove that var keyword on line 137. A better fix would also include converting this project to use the let keyword. Eventually, setuping eslint correctly would have caught something like this.
The text was updated successfully, but these errors were encountered:
I am very willing to contribute to the js-xss. I think it's possible to add an eslint first to improve code readability. I'm also more than willing to help if you want to rewrite in es6/typescript.
I was tracking down an issue I had and was reading the code when I saw this :
js-xss/lib/xss.js
Lines 133 to 140 in daa471e
Even my IDE was confused by this and we both thought (upon first glance) that the line 137 was shadowing the one on 135 but that was not the case since this project is using "var" instead of "let".
Since the var keyword hoists the declaration to the top of the function, the line 137 does not in fact shadow the previous one, but that is very confusing when reading the code.
I think that the easiest fix would be to simply remove that var keyword on line 137. A better fix would also include converting this project to use the let keyword. Eventually, setuping eslint correctly would have caught something like this.
The text was updated successfully, but these errors were encountered: