Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performing block_given? from inside an orphan block always returns false #5039

Closed
dearblue opened this issue Jul 16, 2020 · 0 comments
Closed

Comments

@dearblue
Copy link
Contributor

I noticed that while working on #5038, when I do a block_given? from within an orphan block, it always returns false.
When I tried the old mruby, it returned true until mruby-1.3.0.

% for i in 1.2.0 1.3.0 1.4.0 1.4.1 2.0.0 2.0.1 2.1.0 2.1.1 \
  do \
    echo -n "mruby-$i  " \
    mruby-$i/build/host/bin/mruby -e 'def f(&b); -> { [!!b, block_given?] }; end; p f{}.call' \
  done
mruby-1.2.0  [true, true]
mruby-1.3.0  [true, true]
mruby-1.4.0  [true, false]
mruby-1.4.1  [true, false]
mruby-2.0.0  [true, false]
mruby-2.0.1  [true, false]
mruby-2.1.0  [true, false]
mruby-2.1.1  [true, false]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant