Commit ef69738
authored
Treat return in block in class/module as LocalJumpError (ruby#2511)
return directly in class/module is an error, so return in
proc in class/module should also be an error. I believe the
previous behavior was an unintentional oversight during the
addition of top-level return in 2.4.1 parent 9759e3c commit ef69738
File tree
3 files changed
+20
-11
lines changed- spec/ruby/language
- test/ruby
3 files changed
+20
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
454 | 455 | | |
455 | | - | |
456 | | - | |
| 456 | + | |
| 457 | + | |
457 | 458 | | |
458 | 459 | | |
459 | 460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1272 | 1272 | | |
1273 | 1273 | | |
1274 | 1274 | | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1275 | 1279 | | |
1276 | 1280 | | |
1277 | 1281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
1261 | | - | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1262 | 1265 | | |
1263 | 1266 | | |
1264 | 1267 | | |
| |||
1276 | 1279 | | |
1277 | 1280 | | |
1278 | 1281 | | |
| 1282 | + | |
1279 | 1283 | | |
1280 | 1284 | | |
1281 | 1285 | | |
| |||
0 commit comments