summaryrefslogtreecommitdiff
path: root/test/json/ractor_test.rb
diff options
context:
space:
mode:
authorJeremy Evans <[email protected]>2023-10-25 12:49:28 -0700
committerJeremy Evans <[email protected]>2023-12-07 09:30:36 -0800
commit3a88de3ca73052809f5c0bfb4ef8cd435b29ae5f (patch)
treed2b80103106391194d69322940bb43a8ca00e177 /test/json/ractor_test.rb
parent0c3593b6573b4186c980fb4ea7635bf95261c749 (diff)
Support eval "return" at toplevel
Since Ruby 2.4, `return` is supported at toplevel. This makes `eval "return"` also supported at toplevel. This mostly uses the same tests as direct `return` at toplevel, with a couple differences: `END {return if false}` is a SyntaxError, but `END {eval "return" if false}` is not an error since the eval is never executed. `END {return}` is a SyntaxError, but `END {eval "return"}` is a LocalJumpError. The following is a SyntaxError: ```ruby class X nil&defined?0--begin e=no_method_error(); return; 0;end end ``` However, the following is not, because the eval is never executed: ```ruby class X nil&defined?0--begin e=no_method_error(); eval "return"; 0;end end ``` Fixes [Bug #19779]
Diffstat (limited to 'test/json/ractor_test.rb')
0 files changed, 0 insertions, 0 deletions