[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gnash-commit
Subject:    [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-2199-gdc51f53
From:       Sandro Santilli <strk () keybit ! net>
Date:       2015-08-28 18:57:58
Message-ID: E1ZVOqc-0003se-Mp () vcs ! savannah ! gnu ! org
[Download RAW message or body]

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  dc51f5389e4726486b631864151dcfe28e556cf6 (commit)
      from  062edf672abbd849a4a67447b5c3fb9f30d1a701 (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=dc51f5389e4726486b631864151dcfe28e556cf6


commit dc51f5389e4726486b631864151dcfe28e556cf6
Author: Nutchanon Wetchasit <Nutchanon.Wetchasit@gmail.com>
Date:   Fri Aug 28 20:57:37 2015 +0200

    Use String return type in GetVariable() host interface.

diff --git a/libcore/movie_root.cpp b/libcore/movie_root.cpp
index dbcdf1c..4ecfb35 100644
--- a/libcore/movie_root.cpp
+++ b/libcore/movie_root.cpp
@@ -1598,9 +1598,15 @@ movie_root::processInvoke(ExternalInterface::invoke_t *invoke)
         VM &vm = getVM();
         std::string var = invoke->args[0].to_string();
         as_value val;
-        obj->get_member(getURI(vm, var), &val);
-        // GetVariable sends the value of the variable
-        ss << ExternalInterface::toXML(val);
+        if (obj->get_member(getURI(vm, var), &val)) {
+            // If the variable exists, GetVariable returns a string
+            // representation of its value. Variable with undefined
+            // or null value counts as exist too.
+            ss << ExternalInterface::toXML(val.to_string());
+        } else {
+            // If the variable does not exist, GetVariable sends null value
+            ss << ExternalInterface::toXML(as_value((as_object*)NULL));
+        }
     } else if (invoke->name == "GotoFrame") {
         log_unimpl(_("ExternalInterface::GotoFrame()"));
         // GotoFrame doesn't send a response

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

Summary of changes:
 libcore/movie_root.cpp |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Gnash

_______________________________________________
Gnash-commit mailing list
Gnash-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/gnash-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic