I'm using ES6 to develop a Web Extension. The Mozilla add-on approval process requires that your code to pass a validation tool which doesn't like the resulting code. More information at developer.mozilla.org/en/XUL_School/Appendix_C:_A…
Tommy Hodgins
CSS & Element Queries
How does your code make use of
eval()? If you're trying to evaluate strings one way I've been able to refactoreval()out of my code has been by usingnew Function()with a string that includesreturnplus whatever you're trying to evaluate. Consider this test:var string = 'innerWidth * 2' var result1 = eval(string) var result2 = new Function('return ' + string) console.log(result1) console.log(result2())The result of both should be the same. Normally
'innerWidth * 2'is just a string and would be handled as text, but when you run it througheval(string)ornew Function('return ' + string)it should print a number equal to 2x your browser's width in the console.Maybe using a trick like this can help you refactor
eval()out of your code :D