[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/trunk r11236: Get enumeration more correct
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] /srv/bzr/gnash/trunk r11236: Get enumeration more correct. Fixes bug #19926 and passes new tests. |
Date: |
Thu, 09 Jul 2009 10:01:27 +0200 |
User-agent: |
Bazaar (1.13.1) |
------------------------------------------------------------
revno: 11236
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2009-07-09 10:01:27 +0200
message:
Get enumeration more correct. Fixes bug #19926 and passes new tests.
modified:
libcore/MovieClip.cpp
libcore/PropertyList.cpp
libcore/asobj/Object.cpp
testsuite/misc-ming.all/registerClassTest.c
------------------------------------------------------------
revno: 11232.1.1
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-07-09 08:23:38 +0200
message:
Cut some unnecessary syntax.
modified:
libcore/asobj/Object.cpp
------------------------------------------------------------
revno: 11232.1.2
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-07-09 08:24:14 +0200
message:
The __constructor__ property also shouldn't be enumerated in MovieClips.
modified:
libcore/MovieClip.cpp
------------------------------------------------------------
revno: 11232.1.3
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-07-09 09:05:27 +0200
message:
Also don't enumerate the constructor property.
modified:
libcore/MovieClip.cpp
------------------------------------------------------------
revno: 11232.1.4
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-07-09 09:26:44 +0200
message:
Minor cleanup.
modified:
libcore/PropertyList.cpp
------------------------------------------------------------
revno: 11232.1.5
committer: Benjamin Wolsey <address@hidden>
branch nick: work
timestamp: Thu 2009-07-09 09:26:49 +0200
message:
Don't enumerate unnamed "non-properties" (MovieClip displaylist members).
modified:
libcore/MovieClip.cpp
=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp 2009-06-17 15:33:51 +0000
+++ b/libcore/MovieClip.cpp 2009-07-09 07:26:49 +0000
@@ -2151,10 +2151,14 @@
if ( swfversion > 5 )
{
+ const int flags = as_prop_flags::dontEnum;
+
set_member(NSV::PROP_uuCONSTRUCTORuu, ctor);
+ set_member_flags(NSV::PROP_uuCONSTRUCTORuu, flags);
if ( swfversion == 6 )
{
set_member(NSV::PROP_CONSTRUCTOR, ctor);
+ set_member_flags(NSV::PROP_CONSTRUCTOR, flags);
}
// Provide a 'super' reference..
@@ -2477,10 +2481,14 @@
void operator() (DisplayObject* ch)
{
- // don't enumerate unloaded DisplayObjects
- if ( ch->unloaded() ) return;
-
- _env.push(ch->get_name());
+ // Don't enumerate unloaded DisplayObjects
+ if (ch->unloaded()) return;
+
+ const std::string& name = ch->get_name();
+ // Don't enumerate unnamed DisplayObjects
+ if (name.empty()) return;
+
+ _env.push(name);
}
};
=== modified file 'libcore/PropertyList.cpp'
--- a/libcore/PropertyList.cpp 2009-07-02 05:45:49 +0000
+++ b/libcore/PropertyList.cpp 2009-07-09 07:26:44 +0000
@@ -310,17 +310,17 @@
typedef container::nth_index<1>::type ContainerByOrder;
for (ContainerByOrder::const_reverse_iterator
i=_props.get<1>().rbegin(),
- ie=_props.get<1>().rend(); i != ie; ++i)
- {
- if (i->getFlags().get_dont_enum())
- continue;
-
- if (donelist.insert(std::make_pair(i->mName,
i->mNamespace)).second)
- {
- if (i->mNamespace)
- env.push(as_value(st.value(i->mName) + "." +
st.value(i->mNamespace)));
- else
- env.push(as_value(st.value(i->mName)));
+ ie=_props.get<1>().rend(); i != ie; ++i) {
+
+ if (i->getFlags().get_dont_enum()) continue;
+
+ if (donelist.insert(std::make_pair(i->mName,
i->mNamespace)).second) {
+
+ const std::string& qname = i->mNamespace ?
+ st.value(i->mName) + "." + st.value(i->mNamespace) :
+ st.value(i->mName);
+
+ env.push(qname);
}
}
}
=== modified file 'libcore/asobj/Object.cpp'
--- a/libcore/asobj/Object.cpp 2009-06-03 16:05:40 +0000
+++ b/libcore/asobj/Object.cpp 2009-07-09 06:23:38 +0000
@@ -317,8 +317,8 @@
// Check that the exported resource is a sprite_definition
// (we're looking for a MovieClip symbol)
- boost::intrusive_ptr<sprite_definition> exp_clipdef =
-
boost::intrusive_ptr<sprite_definition>(dynamic_cast<sprite_definition*>(exp_res.get()));
+ boost::intrusive_ptr<sprite_definition> exp_clipdef(
+ dynamic_cast<sprite_definition*>(exp_res.get()));
if ( ! exp_clipdef )
@@ -327,9 +327,7 @@
log_aserror(_("Object.registerClass(%s, %s): "
"exported symbol is not a MovieClip symbol "
"(sprite_definition), but a %s"),
- symbolid,
- typeid(theclass).name(),
- typeid(*exp_res).name());
+ symbolid, typeName(theclass), typeName(exp_res));
);
return as_value(false);
}
=== modified file 'testsuite/misc-ming.all/registerClassTest.c'
--- a/testsuite/misc-ming.all/registerClassTest.c 2009-07-09 07:44:52
+0000
+++ b/testsuite/misc-ming.all/registerClassTest.c 2009-07-09 08:01:27
+0000
@@ -181,7 +181,7 @@
// Check that non-enumerable properties (unnamed instances,
// constructor, __constructor__) are not enumerated.
add_actions(mo, "var s = ''; for (i in clip1) { s += i + ','; };");
- xcheck_equals(mo, "s", "'onRollOver,'");
+ check_equals(mo, "s", "'onRollOver,'");
check_equals(mo, "typeof(clip2)", "'movieclip'");
check(mo, "clip2 instanceOf CustomClass");
@@ -198,7 +198,7 @@
// Check that non-enumerable properties (unnamed instances,
// constructor, __constructor__) are not enumerated.
add_actions(mo, "var s = ''; for (i in clip2) { s += i + ','; };");
- xcheck_equals(mo, "s", "'onLoad,onRollOver,'");
+ check_equals(mo, "s", "'onLoad,onRollOver,'");
check(mo, "clip3.hasOwnProperty('__constructor__')");
check(mo, "clip3.hasOwnProperty('constructor')");
@@ -214,7 +214,7 @@
// Check that non-enumerable properties (unnamed instances,
// constructor, __constructor__) are not enumerated.
add_actions(mo, "var s = ''; for (i in clip3) { s += i + ','; };");
- xcheck_equals(mo, "s", "'onRollOver,'");
+ check_equals(mo, "s", "'onRollOver,'");
check(mo, "clip4.hasOwnProperty('__constructor__')");
check(mo, "clip4.hasOwnProperty('constructor')");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/trunk r11236: Get enumeration more correct. Fixes bug #19926 and passes new tests.,
Benjamin Wolsey <=