Created
May 24, 2023 08:58
-
-
Save aereal/493f994c04b0351cc5d85d8fbf10fe09 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
def scope_while | |
while true | |
x = 1 | |
break | |
end | |
if x == 1 | |
# noop | |
end | |
end | |
def scope_begin | |
begin | |
x = 1 | |
ensure | |
# noop | |
end | |
if x == 1 | |
# noop | |
end | |
end | |
def scope_loop | |
loop do | |
x = 1 | |
break | |
end | |
if x == 1 | |
# noop | |
end | |
end | |
begin | |
scope_while | |
rescue NameError | |
puts :ng_while | |
end | |
begin | |
scope_begin | |
rescue NameError | |
puts :ng_begin | |
end | |
begin | |
scope_loop | |
rescue NameError | |
puts :ng_loop | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment