<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -18,6 +18,14 @@ end
 
 class SpiderMonkey::Value
   
+  def to_proc
+    if typeof == &quot;function&quot;
+      proc {|*args| self.call_function(&quot;call&quot;, self, *args) }
+    else
+      raise TypeError, &quot;You cannot convert a #{typeof} to a proc&quot;
+    end
+  end
+  
   def method_missing(meth, *args)
     if val = meth.to_s.match(/^(.*)=$/)
       set_property(val[1], *args)</diff>
      <filename>interactive.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>01453412474545670add5af36683117e11f4d2d4</id>
    </parent>
  </parents>
  <author>
    <name>Yehuda Katz</name>
    <email>wycats@gmail.com</email>
  </author>
  <url>http://github.com/matthewd/ruby-mozjs/commit/0a6ebefdb20b9a23f8f1bfa2ac570970fb88796b</url>
  <id>0a6ebefdb20b9a23f8f1bfa2ac570970fb88796b</id>
  <committed-date>2008-04-16T18:49:25-07:00</committed-date>
  <authored-date>2008-04-16T18:49:25-07:00</authored-date>
  <message>Function#to_proc</message>
  <tree>cfb02863ceac3a6b8e70c2fa1f96919e0abf4b61</tree>
  <committer>
    <name>Yehuda Katz</name>
    <email>wycats@gmail.com</email>
  </committer>
</commit>
