Tucker,
I've written some test cases and found some that I can't pass - indeed, the
current version cannot pass it either. Here's a representative one:
<attribute name="attrValue" value="ATTRIBUTE VALUE" type="string" />
<!-- no shadowing, just grab the attrValue -->
<method name="closureOverUnshadowedValue2" args="">
return function inner () {
return attrValue;
}
</method>
The method should return "ATTRIBUTE VALUE", and it does in SWF10. But in the
current version of DHTML, it returns undefined, even though it's wrapped by
with(this). And my changes don't fix this either. FWIW, explicit setting of
this. does not do the right thing:
<method name="closureOverUnshadowedValue2" args="">
return function inner () {
return this.attrValue;
}
</method>
That returns undefined as well. But here's an approach that does work:
<method name="closureOverUnshadowedValue2" args="">
var _this = this;
return function inner () {
return _this.attrValue;
}
</method>
(Would wrapping the entire function in 'var _this = this; with (_this) {....}'
work? I don't know yet)
I'm inclined to defer this with another JIRA so we can push through the major
improvement, and we aren't breaking anything that isn't already broken.
- Don
--
Don Anderson
Java/C/C++, Berkeley DB, systems consultant
voice: 617-306-2057
email: [email protected]
www: http://www.ddanderson.com
blog: http://libdb.wordpress.com