[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog server/as_environment.cpp
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog server/as_environment.cpp |
Date: |
Tue, 19 Dec 2006 19:05:58 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 06/12/19 19:05:58
Modified files:
. : ChangeLog
server : as_environment.cpp
Log message:
* server/as_environment.cpp (set_variable_raw,
get_variable_raw):
give local vars precedence.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.1973&r2=1.1974
http://cvs.savannah.gnu.org/viewcvs/gnash/server/as_environment.cpp?cvsroot=gnash&r1=1.45&r2=1.46
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.1973
retrieving revision 1.1974
diff -u -b -r1.1973 -r1.1974
--- ChangeLog 19 Dec 2006 18:00:12 -0000 1.1973
+++ ChangeLog 19 Dec 2006 19:05:58 -0000 1.1974
@@ -1,5 +1,7 @@
2006-12-19 Sandro Santilli <address@hidden>
+ * server/as_environment.cpp (set_variable_raw, get_variable_raw):
+ give local vars precedence.
* server/vm/ASHandlers.cpp: use ActionExec methods for variables
manipulation.
* server/vm/ActionExec.{cpp,h}: added variable manipulation
Index: server/as_environment.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/as_environment.cpp,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- server/as_environment.cpp 19 Dec 2006 12:01:02 -0000 1.45
+++ server/as_environment.cpp 19 Dec 2006 19:05:58 -0000 1.46
@@ -16,7 +16,7 @@
//
-/* $Id: as_environment.cpp,v 1.45 2006/12/19 12:01:02 strk Exp $ */
+/* $Id: as_environment.cpp,v 1.46 2006/12/19 19:05:58 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -82,6 +82,13 @@
as_value val;
+ // Check locals for getting them
+ LocalFrames::const_iterator it = findLocal(varname, true);
+ if (it != endLocal()) {
+ // Get local var.
+ return it->m_value;
+ }
+
// Check the with-stack.
for (size_t i = with_stack.size(); i > 0; --i) {
// const_cast needed due to non-const as_object::get_member
@@ -97,13 +104,6 @@
return val;
}
- // Check locals for getting them
- LocalFrames::const_iterator it = findLocal(varname, true);
- if (it != endLocal()) {
- // Get local var.
- return it->m_value;
- }
-
// Looking for "this"?
if (varname == "this") {
val.set_as_object(m_target);
@@ -241,6 +241,16 @@
const as_value& val,
const ScopeStack& with_stack)
{
+
+ // Check locals for setting them
+ LocalFrames::iterator it = findLocal(varname, true);
+ if (it != endLocal()) {
+ // Set local var.
+ it->m_value = val;
+ return;
+ }
+
+
// Check the with-stack.
for (size_t i = with_stack.size(); i > 0; --i)
{
@@ -254,16 +264,7 @@
}
}
- // Check locals for setting them
- LocalFrames::iterator it = findLocal(varname, true);
- if (it != endLocal()) {
- // Set local var.
- it->m_value = val;
- return;
- }
-
assert(m_target);
-
m_target->set_member(varname.c_str(), val);
}