3 ms·
This is not pure way of doing meta programming. It looks at the code to figure out what methods are being called in future. Opal.add_stubs(["first", "second",
by ankurpatel 12y ago
This is not pure way of doing meta programming. It looks at the code to figure out what methods are being called in future.
Opal.add_stubs(["first", "second", "to_sym"]);
But lets say I am dynamically generating method using a string passed from user input or server then this would fail.
- elia 12y agoI had the same fear at first, but actually if you generate dynamically a method name you need to use `#__send__` (and friends) to call it. Of course `#__send__` supports method_missing: https://github.com/opal/opal/blob/0-6-stable/opal/corelib/basic_object.rb#L13-L31 https://github.com/opal/opal/blob/0-6-stable/opal/corelib/ba...