Closed headius closed 1 month ago
This allows JRuby's JIT set at a compilation threshold of 0 to exercise these specs, and showed several failures all the same cause as jruby/jruby#8283 (fixed by jruby/jruby#8284).
Closing in favor of removing the evals.
See #1155 for the actual fix.
Another thought on this is there will likely always be a few eval
's in ruby/spec for syntax which is not supported by the oldest supported Ruby version in ruby/spec.
These evals should almost always be literal strings though, so one way to compile them would be to actually remove the eval at parse time, but it's certainly hacky (e.g. hard to prove it's a call to Kernel#eval) and when we can remove the eval's like here, the better.
I'm mentioning it because this also applies e.g. for other usages of ruby/spec like testing parsers, rubocop, etc.
This replaces most evals of patterns with evaluation into and invoking of a temporary method. The remaining cases depend on surrounding state that would need to be moved into the eval string to work properly.
Partially addresses #1152