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

block_given? always returns false when it calls in block #2703

Closed
wants to merge 1 commit into from

Conversation

suzukaze
Copy link
Contributor

Fix #2695
I made sure #2665, #2678 are not destroyed.

block_given? always returns false when it calls in block.
block cannot recieve block.

Could you tell me a sample code that block_given? return true in block.

@cremno
Copy link
Contributor

cremno commented Jan 16, 2015

Could you tell me a sample code that block_given? return true in block.

Something like this? (It doesn't return true anymore after applying your patch.)

def foo; define_singleton_method(:bar) { block_given? }; end; foo {}; bar

@suzukaze
Copy link
Contributor Author

@cremno Thank you very much.
I close this PR.

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

Successfully merging this pull request may close these issues.

block_given? does not work with nested blocks
2 participants