gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r12264: Correct Point. New test pass


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12264: Correct Point. New test passes.
Date: Sat, 19 Jun 2010 18:13:12 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12264 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Sat 2010-06-19 18:13:12 +0200
message:
  Correct Point. New test passes.
modified:
  libcore/asobj/flash/geom/Point_as.cpp
  testsuite/swfdec/PASSING
=== modified file 'libcore/asobj/flash/geom/Point_as.cpp'
--- a/libcore/asobj/flash/geom/Point_as.cpp     2010-03-11 01:47:08 +0000
+++ b/libcore/asobj/flash/geom/Point_as.cpp     2010-06-19 14:35:56 +0000
@@ -374,14 +374,15 @@
     ptr->get_member(NSV::PROP_X, &x);
     ptr->get_member(NSV::PROP_Y, &y);
 
-    int version = getSWFVersion(fn);
-
-    std::stringstream ss;
-    ss << "(x=" << x.to_string(version)
-        << ", y=" << y.to_string(version)
-        << ")";
-
-    return as_value(ss.str());
+    VM& vm = getVM(fn);
+
+    as_value ret("(x=");
+    newAdd(ret, x, vm);
+    newAdd(ret, ", y=", vm);
+    newAdd(ret, y, vm);
+    newAdd(ret, ")", vm);
+
+    return ret;
 }
 
 as_value
@@ -605,36 +606,16 @@
 as_value
 point_ctor(const fn_call& fn)
 {
-
     as_object* obj = ensure<ValidThis>(fn);
 
-    as_value x;
-    as_value y;
-
-    if ( ! fn.nargs )
-    {
-        x.set_double(0);
-        y.set_double(0);
-    }
-    else
-    {
-        do {
-            x = fn.arg(0);
-            if ( fn.nargs < 2 ) break;
-            y = fn.arg(1);
-            if ( fn.nargs < 3 ) break;
-            IF_VERBOSE_ASCODING_ERRORS(
-                std::stringstream ss;
-                fn.dump_args(ss);
-                log_aserror("flash.geom.Point(%s): %s", ss.str(),
-                    _("arguments after the first two discarded"));
-            );
-        } while(0);
-    }
-
-    obj->set_member(NSV::PROP_X, x);
-    obj->set_member(NSV::PROP_Y, y);
-
+    if (!fn.nargs) {
+        obj->set_member(NSV::PROP_X, 0.0);
+        obj->set_member(NSV::PROP_Y, 0.0);
+    }
+    else {
+        obj->set_member(NSV::PROP_X, fn.arg(0));
+        obj->set_member(NSV::PROP_Y, (fn.nargs > 1) ? fn.arg(1) : as_value());
+    }
     return as_value(); 
 }
 

=== modified file 'testsuite/swfdec/PASSING'
--- a/testsuite/swfdec/PASSING  2010-06-19 08:43:49 +0000
+++ b/testsuite/swfdec/PASSING  2010-06-19 14:37:18 +0000
@@ -1003,6 +1003,9 @@
 point-6.swf:3fdd925da68bb3eba7c812b6a037e17f
 point-7.swf:71e79f89b7b54db6621fa5888c93e9f2
 point-8.swf:71eaa77c0f2140096edda7522da49f99
+point-construct-6.swf:62d37a269a53483d94bb2d26d8d11436
+point-construct-7.swf:825c430e18286d1a97ad9260cb2f0d11
+point-construct-8.swf:7f1b4b2335fd2abcdbd2229cf1c84957
 point-properties-5.swf:2b1071acd6c53d5342c1946214a3b3df
 point-properties-5.swf:c3439d59fa29fb709630ee3a3ad230b0
 point-properties-6.swf:e3b094aebc412bf8f1e2b14d7752fd74


reply via email to

[Prev in Thread] Current Thread [Next in Thread]