diff options
author | Jeremy Evans <[email protected]> | 2024-09-18 16:54:56 -0700 |
---|---|---|
committer | <[email protected]> | 2024-09-18 16:54:56 -0700 |
commit | 268c72377b06b7d84a0998ca241340d0f58768f6 () | |
tree | 517bcd762780681b88a2cea5d6318b7a244a6144 /bootstraptest/test_eval.rb | |
parent | 984a791d58ec4350d62714a2d063c1bb54707bb6 (diff) |
Raise a compile error for break/next/redo inside eval in cases where it is optimized away
In cases where break/next/redo are not valid syntax, they should raise a SyntaxError even if inside a conditional block that is optimized away. Fixes [Bug #20597] Co-authored-by: Kevin Newton <[email protected]>
Notes: Merged: https://.com/ruby/ruby/pull/11099 Merged-By: jeremyevans <[email protected]>
-rw-r--r-- | bootstraptest/test_eval.rb | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -217,7 +217,7 @@ assert_equal %q{[10, main]}, %q{ } %w[break next redo].each do |keyword| - assert_match %r"Can't escape from eval with #{keyword}\b", %{ $stderr = STDOUT begin eval "0 rescue #{keyword}" |