Skip to content

Commit

Permalink
Pass parameters & arity info from method to proc
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Nov 29, 2018
1 parent 1aa0333 commit e4f3590
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions opal/corelib/method.rb
Expand Up @@ -43,6 +43,8 @@ def to_proc
var proc = self.$call.bind(self);
proc.$$unbound = #{@method};
proc.$$is_lambda = true;
proc.$$arity = #{@method}.$$arity;
proc.$$parameters = #{@method}.$$parameters;
return proc;
}
end
Expand Down
1 change: 0 additions & 1 deletion spec/filters/bugs/method.rb
Expand Up @@ -45,7 +45,6 @@
fails "Method#super_method returns nil when the parent's method is removed"
fails "Method#super_method returns nil when there's no super method in the parent"
fails "Method#super_method returns the method that would be called by super in the method"
fails "Method#to_proc returns a Proc object with the correct arity"
fails "Method#to_proc returns a proc that can be used by define_method"
fails "Method#to_proc returns a proc that can receive a block"
fails "Method#to_proc returns a proc whose binding has the same receiver as the method" # NoMethodError: undefined method `receiver' for nil
Expand Down

0 comments on commit e4f3590

Please sign in to comment.