execjs icon indicating copy to clipboard operation
execjs copied to clipboard

ExecJS.eval does not tolerate trailing semicolon

Open betelgeuse opened this issue 7 years ago • 0 comments

irb(main):009:0> ExecJS.runtime
=> #<ExecJS::MiniRacerRuntime:0x007feb4abf7178>
irb(main):010:0> ExecJS.eval '1+2'
=> 3
irb(main):011:0>  ExecJS.eval '1+2;'
ExecJS::RuntimeError: Uncaught SyntaxError: Unexpected token ; at undefined:1:4

I think ExecJS.eval should tolerate trailing semicolons. I had this happen in a library stack where a library js file ended with a semicolon and the stack was feeding it to eval.

betelgeuse avatar Jul 28 '17 10:07 betelgeuse