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. cd355522902bd4574860


From: Sandro Santilli
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. cd355522902bd457486043a4e4f491e9532e8c17
Date: Thu, 14 Oct 2010 13:12:50 +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  cd355522902bd457486043a4e4f491e9532e8c17 (commit)
       via  5f4518aa48744d34d5de797f798ddb10422bad18 (commit)
      from  07b8ae4bdd8c8f99e81116280d94a444579abca6 (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=cd355522902bd457486043a4e4f491e9532e8c17


commit cd355522902bd457486043a4e4f491e9532e8c17
Author: Sandro Santilli <address@hidden>
Date:   Thu Oct 14 15:12:45 2010 +0200

    ExternalInterface.call returns undefined on error, null on unavailable

diff --git a/libcore/asobj/flash/external/ExternalInterface_as.cpp 
b/libcore/asobj/flash/external/ExternalInterface_as.cpp
index 8759e57..036ad23 100644
--- a/libcore/asobj/flash/external/ExternalInterface_as.cpp
+++ b/libcore/asobj/flash/external/ExternalInterface_as.cpp
@@ -271,6 +271,12 @@ externalinterface_call(const fn_call& fn)
     movie_root& mr = getRoot(fn);
     as_value val;
 
+    if (mr.getControlFD() <= 0) {
+        log_debug("ExternalInterface not accessible on call.");
+        val.set_null();
+        return as_value(val);
+    }
+
     if (fn.nargs > 1) {
         const as_value& methodName_as = fn.arg(0);
         const std::string methodName = methodName_as.to_string();
@@ -282,12 +288,10 @@ externalinterface_call(const fn_call& fn)
             // There was an error trying to Invoke the callback
             if (result == ExternalInterface::makeString("Error")
                 || (result == ExternalInterface::makeString("SecurityError"))) 
{
-                val.set_null();
+                log_trace("VAL: %s", val);
+                val.set_undefined();
             }
-        } else {
-            // We got nothing back from the Invoke, so return an error
-            val.set_null();
-        }
+        } 
     }
     
     return val;

http://git.savannah.gnu.org/cgit//commit/?id=5f4518aa48744d34d5de797f798ddb10422bad18


commit 5f4518aa48744d34d5de797f798ddb10422bad18
Author: Sandro Santilli <address@hidden>
Date:   Thu Oct 14 15:01:25 2010 +0200

    addCallback returns true if external interface is available (tested)

diff --git a/libcore/asobj/flash/external/ExternalInterface_as.cpp 
b/libcore/asobj/flash/external/ExternalInterface_as.cpp
index 99ae23d..8759e57 100644
--- a/libcore/asobj/flash/external/ExternalInterface_as.cpp
+++ b/libcore/asobj/flash/external/ExternalInterface_as.cpp
@@ -259,8 +259,8 @@ externalinterface_addCallback(const fn_call& fn)
         }
     }
 
-    // Documented to return a boolean, but seems untested.
-    return as_value(false);    
+    // Returns true unless unavailable (which we checked above)
+    return as_value(true);    
 }
 
 // This calls a Javascript function in the browser.

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

Summary of changes:
 .../asobj/flash/external/ExternalInterface_as.cpp  |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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