Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error with new HEREDOC syntax #128

Closed
ramonvic opened this issue Sep 13, 2023 · 3 comments
Closed

Syntax error with new HEREDOC syntax #128

ramonvic opened this issue Sep 13, 2023 · 3 comments

Comments

@ramonvic
Copy link

I trying to run new 2.9.0 version in a old ruby version ( 2.1.6 ) but the new HEREDOC <<~ is not compatible with that version. Has nay reason to use? since execjs has not constraints to be used on that version.
Current Stacktrace:
SyntaxError: ~/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/execjs-2.9.0/lib/execjs/external_runtime.rb:106: syntax error, unexpected ',', expecting keyword_end instance_eval <<~RUBY, __FILE__, __LINE__

@byroot
Copy link
Member

byroot commented Sep 13, 2023

I'll add the version constraint for the next release.

@byroot byroot closed this as completed in 6c1c228 Sep 13, 2023
@ramonvic
Copy link
Author

But is there any need for this constraint? I didn't see anything, except what I mentioned, that it was necessary to have ruby > 2.3. for old projects, we would lose the possibility of updating the gem.

@byroot
Copy link
Member

byroot commented Sep 13, 2023

But is there any need for this constraint?

Yes. If we can't run CI on such old version, then it becomes impossible to prevent changes such as this one to go through.

As you can see only 2.5+ is tested because testing older versions would require jumping through tons of hoops (e.g. get mini_racer to compile, etc).

I didn't see anything, except what I mentioned

There is also keyword arguments: https://github.com/casperisfine/execjs/actions/runs/6172058727/job/16751545205#step:7:22

And here you can see how much we'd have to workaround: master...casperisfine:execjs:test-1.9.3

I'm always happy to support EOL ruby versions as long as it's not a big hassle, here it is one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants