gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. 1ad30624a91837d461cc


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 1ad30624a91837d461cc196e552ecc3330e9f2e3
Date: Thu, 14 Oct 2010 18:50:16 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  1ad30624a91837d461cc196e552ecc3330e9f2e3 (commit)
      from  6d8de5bb11616820641f6d9bd105ff6a8a28eaec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=1ad30624a91837d461cc196e552ecc3330e9f2e3


commit 1ad30624a91837d461cc196e552ecc3330e9f2e3
Author: Sandro Santilli <address@hidden>
Date:   Thu Oct 14 20:49:56 2010 +0200

    Properly implement ExternalInterface::_objectToXML

diff --git a/libcore/ExternalInterface.cpp b/libcore/ExternalInterface.cpp
index fac2eef..814891d 100644
--- a/libcore/ExternalInterface.cpp
+++ b/libcore/ExternalInterface.cpp
@@ -135,19 +135,16 @@ ExternalInterface::objectToXML(as_object *obj)
     
     std::stringstream ss;
 
-    if (obj == 0) {
-        //log_error("Need a valid AS Object!");
-        return ss.str();
+    ss << "<object>";
+
+    if (obj) {
+        VM& vm = getVM(*obj);
+        // Get all the properties
+        PropsSerializer props(vm);
+        obj->visitProperties<IsEnumerable>(props);
+        ss << props.getReverseXML();
     }
 
-    VM& vm = getVM(*obj);
-    
-    ss << "<object>";
-    
-    // Get all the properties
-    PropsSerializer props(vm);
-    obj->visitProperties<IsEnumerable>(props);
-    ss << props.getReverseXML();
     ss << "</object>";
     
     return ss.str();
diff --git a/libcore/asobj/flash/external/ExternalInterface_as.cpp 
b/libcore/asobj/flash/external/ExternalInterface_as.cpp
index af9d46a..b08a37c 100644
--- a/libcore/asobj/flash/external/ExternalInterface_as.cpp
+++ b/libcore/asobj/flash/external/ExternalInterface_as.cpp
@@ -567,17 +567,14 @@ externalinterface_uObjectToXML(const fn_call& fn)
 {
     // GNASH_REPORT_FUNCTION;
     
-    if (fn.nargs == 1) {
-        if (!fn.arg(0).is_null() && !fn.arg(0).is_undefined()) {
-            as_object *obj = toObject(fn.arg(0), getVM(fn));
-            std::string str = ExternalInterface::objectToXML(obj);
-            return as_value(str);
-        } else {
-            return as_value("<object></object>");
-        }
+    as_object *obj = 0;
+
+    if (fn.nargs) {
+        obj = toObject(fn.arg(0), getVM(fn));
     }
     
-    return as_value();
+    const std::string& str = ExternalInterface::objectToXML(obj);
+    return as_value(str);
 }
 
 as_value
diff --git a/testsuite/actionscript.all/ExternalInterface.as 
b/testsuite/actionscript.all/ExternalInterface.as
index 9d7c6be..d9ce042 100644
--- a/testsuite/actionscript.all/ExternalInterface.as
+++ b/testsuite/actionscript.all/ExternalInterface.as
@@ -194,7 +194,7 @@ xml = EI._objectToXML(o);
 check_equals (xml, '<object><property 
id="a"><number>1</number></property><property 
id="b"><string>string</string></property></object>');
 
 xml = EI._objectToXML(o, 1, 2, 3);
-xcheck_equals (xml, '<object><property 
id="a"><number>1</number></property><property 
id="b"><string>string</string></property></object>');
+check_equals (xml, '<object><property 
id="a"><number>1</number></property><property 
id="b"><string>string</string></property></object>');
 
 xml = EI._objectToXML(undefined);
 check_equals (xml, '<object></object>');
@@ -206,7 +206,7 @@ xml = EI._objectToXML(6);
 check_equals (xml, '<object></object>');
 
 xml = EI._objectToXML();
-xcheck_equals (xml, '<object></object>');
+check_equals (xml, '<object></object>');
 
 // An Array
 anArray = [ 12, "tr", 1 ];

-----------------------------------------------------------------------

Summary of changes:
 libcore/ExternalInterface.cpp                      |   19 ++++++++-----------
 .../asobj/flash/external/ExternalInterface_as.cpp  |   15 ++++++---------
 testsuite/actionscript.all/ExternalInterface.as    |    4 ++--
 3 files changed, 16 insertions(+), 22 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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