* [ruby-core:121865] [Ruby Bug#21313] `it` in rescue/ensure on prism
@ 2025-05-06 19:45 ko1 (Koichi Sasada) via ruby-core
2025-05-16 5:03 ` [ruby-core:122133] " nicholasdower (Nick Dower) via ruby-core
0 siblings, 1 reply; 2+ messages in thread
From: ko1 (Koichi Sasada) via ruby-core @ 2025-05-06 19:45 UTC (permalink / raw)
To: ruby-core; +Cc: ko1 (Koichi Sasada)
Issue #21313 has been reported by ko1 (Koichi Sasada).
----------------------------------------
Bug #21313: `it` in rescue/ensure on prism
https://bugs.ruby-lang.org/issues/21313
* Author: ko1 (Koichi Sasada)
* Status: Open
* Assignee: prism
* ruby -v: "ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [wasm32-wasi]"
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
```ruby
1.times do
raise
rescue
p it
#=> prism: false
#=> parse.y: 0
end
```
`it` should return 0, shouldn't it?
demo:
parse.y: https://ruby.github.io/play-ruby/?code=p+RUBY_DESCRIPTION%0A%0A1.times+do%0A++raise%0Arescue%0A++p+it%0Aend%0A&options=%7B%22arguments%22%3A%5B%22--parser%3Dparse.y%22%5D%2C%22env%22%3A%7B%7D%7D
prism: https://ruby.github.io/play-ruby/?code=p+RUBY_DESCRIPTION%0A%0A1.times+do%0A++raise%0Arescue%0A++p+it%0Aend%0A&options=%7B%22arguments%22%3A%5B%5D%2C%22env%22%3A%7B%7D%7D
Same on `ensure`.
```ruby
1.times do
raise
ensure
p it #=> prism: false
#=> parse.y: 0
end
```
```ruby
1.times do
begin
raise
ensure
p it #=> prism: false
#=> parse.y: 0
end
end
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
* [ruby-core:122133] [Ruby Bug#21313] `it` in rescue/ensure on prism
2025-05-06 19:45 [ruby-core:121865] [Ruby Bug#21313] `it` in rescue/ensure on prism ko1 (Koichi Sasada) via ruby-core
@ 2025-05-16 5:03 ` nicholasdower (Nick Dower) via ruby-core
0 siblings, 0 replies; 2+ messages in thread
From: nicholasdower (Nick Dower) via ruby-core @ 2025-05-16 5:03 UTC (permalink / raw)
To: ruby-core; +Cc: nicholasdower (Nick Dower)
Issue #21313 has been updated by nicholasdower (Nick Dower).
I encountered this issue today and attempted a fix: https://github.com/ruby/ruby/pull/13360
I hope that was appropriate.
----------------------------------------
Bug #21313: `it` in rescue/ensure on prism
https://bugs.ruby-lang.org/issues/21313#change-113285
* Author: ko1 (Koichi Sasada)
* Status: Assigned
* Assignee: prism
* ruby -v: "ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [wasm32-wasi]"
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
```ruby
1.times do
raise
rescue
p it
#=> prism: false
#=> parse.y: 0
end
```
`it` should return 0, shouldn't it?
demo:
parse.y: https://ruby.github.io/play-ruby/?code=p+RUBY_DESCRIPTION%0A%0A1.times+do%0A++raise%0Arescue%0A++p+it%0Aend%0A&options=%7B%22arguments%22%3A%5B%22--parser%3Dparse.y%22%5D%2C%22env%22%3A%7B%7D%7D
prism: https://ruby.github.io/play-ruby/?code=p+RUBY_DESCRIPTION%0A%0A1.times+do%0A++raise%0Arescue%0A++p+it%0Aend%0A&options=%7B%22arguments%22%3A%5B%5D%2C%22env%22%3A%7B%7D%7D
Same on `ensure`.
```ruby
1.times do
raise
ensure
p it #=> prism: false
#=> parse.y: 0
end
```
```ruby
1.times do
begin
raise
ensure
p it #=> prism: false
#=> parse.y: 0
end
end
```
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- ruby-core@ml.ruby-lang.org
To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-05-16 5:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-06 19:45 [ruby-core:121865] [Ruby Bug#21313] `it` in rescue/ensure on prism ko1 (Koichi Sasada) via ruby-core
2025-05-16 5:03 ` [ruby-core:122133] " nicholasdower (Nick Dower) via ruby-core
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).