elasticsearch-ruby
https://github.com/elastic/elasticsearch-ruby
Ruby
Ruby integrations for Elasticsearch
Opal::Nodes::CallNode#invoke_using_send?
Opal has a runtime helper 'Opal.send_method_name' that assigns
provided block to a '$$p' property of the method body
and invokes a method using 'apply'.
We have to compile a method call using this 'Opal.send_method_name' when a method:
1. takes a splat
2. takes a block
Arguments that contain splat must be handled in a different way.
When a method takes a block we have to calculate all arguments
**before** asigning '$$p' property (that stores a passed block)
to a method body. This is some kind of protection from method calls
like 'a(a {}) { 1 }'.Edit
git clone [email protected]:elastic/elasticsearch-ruby.git
cd elasticsearch-ruby
open
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Opal--Nodes--CallNode-invoke_using_send--for-pr
# Commit to gitgit add git commit -m "better docs for Opal::Nodes::CallNode#invoke_using_send?"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Opal--Nodes--CallNode-invoke_using_send--for-pr
hub pull-request
# Celebrate!