execjs
execjs copied to clipboard
ExecJS.eval does not tolerate trailing semicolon
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.