<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>t6/05.object.t</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,12 +1,20 @@
 
 class JavaScript::Writer-0.0.1 {
+    has $!object;
     has @!statements;
 
     method call($function, @args) {
         @!statements.push({
+            object =&gt; $!object,
             call =&gt; $function,
             args =&gt; @args
-        })
+        });
+        $!object = undef;
+    }
+
+    method object($o) {
+        $!object = $o;
+        return self
     }
 
     method append($code) {
@@ -17,7 +25,10 @@ class JavaScript::Writer-0.0.1 {
         my $ret = &quot;&quot;;
         for @!statements -&gt; my %s {
             if (%s{'call'}) {
-                # Should use JSON.
+                if (%s{'object'}) {
+                    $ret ~= %s{'object'} ~ &quot;.&quot;;
+                }
+                # Should use JSON to build arglist.
                 my $args = %s{'args'}.join(&quot;,&quot;);
                 $ret ~= %s{'call'} ~ &quot;(\&quot;$args\&quot;);&quot;;
             }</diff>
      <filename>lib6/JavaScript/Writer.pm</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2e928440836bdcd43646e2c9b42f726927f32c0a</id>
    </parent>
  </parents>
  <author>
    <name>Kang-min Liu</name>
    <email>gugod@gugod.org</email>
  </author>
  <url>http://github.com/gugod/javascript-writer/commit/63085b35d58bf460204c751d484eb9c3d4256329</url>
  <id>63085b35d58bf460204c751d484eb9c3d4256329</id>
  <committed-date>2007-11-22T03:33:52-08:00</committed-date>
  <authored-date>2007-11-22T03:33:52-08:00</authored-date>
  <message> r18641@GOP (orig r601):  gugod | 2007-09-01 15:02:47 +0800
 implement the 'call this function on this object' feature.
 


git-svn-id: http://code.handlino.com/svn/perl5/JavaScript-Writer@111 b19cb30a-9f2e-4084-8847-5e1a13269302</message>
  <tree>17406e6e9729c28051d04440b0e72c19525e10a3</tree>
  <committer>
    <name>Kang-min Liu</name>
    <email>gugod@gugod.org</email>
  </committer>
</commit>
