I just stumbled upon a strange JavaScript error using Mozilla Rhino as a JavaScript engine.
The error message is displayed in this line of the script:
eval("const a = 5;");
Error:
TypeError: redeclaration of var a.
I would expect this error if the line is executed several times, but it is executed only once, since this one line is the whole program.
Can someone explain why this error occurs?
chriz source
share