Skip to content

ExecJS.eval does not tolerate trailing semicolon #65

Open
@betelgeuse

Description

@betelgeuse
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions