Fixed argument forwarding in instance_exec#6391
Merged
Merged
Conversation
Member
|
Thank you! The same change is probably needed for Class#class_exec in mruby-class-ext too. |
Contributor
Author
|
Thank you for the review. |
However, on C, there is no easy way to pass keyword arguments. Therefore, when called `Kernel#instance_exec` on C, keyword arguments are converted to positional arguments. This is a limitation of current mruby. fixed mruby#6389
Pointed out by @matz. mruby#6391 (comment)
dearblue
force-pushed
the
instance_exec
branch
from
October 24, 2024 13:10
df24835 to
a196d8a
Compare
Contributor
Author
|
Main changes.
And the argument transfer problem with |
dearblue
added a commit
to dearblue/mruby
that referenced
this pull request
Oct 25, 2024
The mruby#6392 has been merged, so the call to `mrb_yield_with_class()` is no longer needed.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
However, on C, there is no easy way to pass keyword arguments. Therefore, when called
Kernel#instance_execon C, keyword arguments are converted to positional arguments. This is a limitation of current mruby.fixed #6389
During our work we found two problems.
One had to do with commit messages, and calling
mrb_exec_irep()from C did not pass arguments.The other was that calls like
instance_exec(1, 2, 3, &:puts)would result in a__send__: main is not a symbol nor a string (TypeError)exception.I will put these together a bit more and add each as a separate issue.