gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r9737: Test/fix MOVIECLIP types with


From: Sandro Santilli
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r9737: Test/fix MOVIECLIP types with amf0
Date: Mon, 15 Sep 2008 07:57:59 +0200
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9737
committer: Sandro Santilli <address@hidden>
branch nick: trunk
timestamp: Mon 2008-09-15 07:57:59 +0200
message:
  Test/fix MOVIECLIP types with amf0
modified:
  libcore/as_value.cpp
  testsuite/misc-ming.all/SharedObjectTest.as
  testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol
    ------------------------------------------------------------
    revno: 9736.1.1
    committer: Sandro Santilli <address@hidden>
    branch nick: mybranch
    timestamp: Sun 2008-09-14 19:11:51 +0200
    message:
      Test MovieClip values in SharedObjects
    modified:
      testsuite/misc-ming.all/SharedObjectTest.as
      testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol
    ------------------------------------------------------------
    revno: 9736.1.2
    committer: Sandro Santilli <address@hidden>
    branch nick: mybranch
    timestamp: Sun 2008-09-14 19:15:27 +0200
    message:
      Serialize MOVIECLIP values as undefined amf0.
    modified:
      libcore/as_value.cpp
=== modified file 'libcore/as_value.cpp'
--- a/libcore/as_value.cpp      2008-09-13 07:58:39 +0000
+++ b/libcore/as_value.cpp      2008-09-14 17:15:27 +0000
@@ -2480,8 +2480,12 @@
 
         case MOVIECLIP:
         {
-            log_unimpl(_(" serialization of MovieClip objects"));
-            return false;
+#ifdef GNASH_DEBUG_AMF_SERIALIZE
+            log_debug(_("writeAMF0: serializing MOVIECLIP (as undefined)"));
+#endif
+            // See misc-ming.all/SharedObjectTest.as
+            buf.appendByte(amf::Element::UNDEFINED_AMF0);
+            return true;
         }
 
         case NULLTYPE:

=== modified file 'testsuite/misc-ming.all/SharedObjectTest.as'
--- a/testsuite/misc-ming.all/SharedObjectTest.as       2008-09-13 08:04:00 
+0000
+++ b/testsuite/misc-ming.all/SharedObjectTest.as       2008-09-14 17:11:51 
+0000
@@ -51,6 +51,14 @@
 check_equals(typeof(so1.data.fbool), 'boolean');
 check_equals(so1.data.fbool, false);
 
+// MovieClip value mc was NOT discarded, but written (or read?) as undefined
+check(so1.data.hasOwnProperty('mc'));
+check_equals(typeof(so1.data.mc), 'undefined');
+
+// Function value was discarded
+check(! so1.data.hasOwnProperty('fun') );
+
+
 // Test reading mixed types in ECMA_ARRAY 
 check_equals(typeof(so1.data.ary), 'object');
 check_equals(so1.data.ary.toString(), '1,true,string,null,');
@@ -81,6 +89,10 @@
 check_equals(typeof(so1.data.obj.a), 'number');
 check(so1.data.obj.hasOwnProperty('a'));
 check(!so1.data.obj.hasOwnProperty('hidden'));
+check(so1.data.obj.hasOwnProperty('mc'));
+check_equals(typeof(so1.data.obj.mc), 'undefined');
+// Function value was discarded
+check(! so1.data.obj.hasOwnProperty('fun') );
 
 // Test reading NUMBER
 check_equals(so1.data.obj.a, 10);
@@ -117,6 +129,7 @@
 
 so1.data.obj = {a:10,b:'20',c:true};
 so1.data.obj.fun = function() {}; // functions in objects are simply skipped
+so1.data.obj.mc = createEmptyMovieClip("mc1", 1); // movieclip values are 
skipped
 
 //AsSetPropFlags(so1.data.obj, '__proto__', 0, 1); // if we unhide __proto__ 
we'll find it in the SharedObject
 
@@ -130,6 +143,7 @@
 so1.data.ref = so1.data.obj;
 
 so1.data.fun = function() {}; // functions in data 
+so1.data.mc = createEmptyMovieClip("mc2", 2); // movieclip values are skipped
 
 //AsSetPropFlags(so1.data, '__proto__', 0, 1); // if we unhide __proto__ we'll 
find it in the SharedObject
 AsSetPropFlags(so1.data, '__constructor__', 0, 1); // unhide __constructor__ 
(it's a function so will be skipped anyway)
@@ -148,4 +162,4 @@
 setInterval(quit, 5000);
 stop();
 
-check_totals(32);
+check_totals(38);

=== modified file 'testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol'
Binary files a/testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol    
2008-09-12 07:16:41 +0000 and 
b/testsuite/misc-ming.all/SharedObjectTest.sol/sol1.sol   2008-09-14 17:11:51 
+0000 differ

reply via email to

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