I see that only view needs the silly recursivecall, and maybe it does
not need that anymore anyways, now that we have the __LZdeleted flag?
I think this ClassCompiler change probably needs a bit more:
Index: ClassCompiler.java
===================================================================
--- ClassCompiler.java (revision 8452)
+++ ClassCompiler.java (working copy)
@@ -332,11 +332,12 @@
Map.Entry entry = (Map.Entry) i.next();
String key = (String) entry.getKey();
Object value = entry.getValue();
+ boolean redeclared = (superclassModel.getAttribute(key) !=
null);
if ((value instanceof NodeModel.BindingExpr)) {
// Bindings always have to be installed as an init
- // A null value indicates that the var was only
- // declared, not initialized
- decls.put(key, null);
+ if (! redeclared) {
+ decls.put(key, null);
+ }
inits.put(key, ((NodeModel.BindingExpr)value).getExpr());
} else if (value instanceof Function &&
((! isstate) ||
@@ -357,23 +358,26 @@
// fixed up in LzNode by installing inits that have no
// setters when the arguments are merged
if (true) { // (! (value instanceof String)) ||
setters.containsKey(key) || isstate) {
- decls.put(key, null);
+ if (! redeclared) {
+ decls.put(key, null);
+ }
inits.put(key, value);
} else {
- decls.put(key, value);
- // If there is a property that would have been shadowed,
- // you have to hide that from applyArgs, or you will get
- // clobbered!
- inits.put(key, "LzNode._ignoreAttribute");
+ if (! redeclared) {
+ decls.put(key, value);
+ // If there is a property that would have been
shadowed,
+ // you have to hide that from applyArgs, or you will
get
+ // clobbered!
+ inits.put(key, "LzNode._ignoreAttribute");
+ } else {
+ inits.put(key, value);
+ }
}
} else {
// Just a declaration
- decls.put(key, value);
-// if (mEnv.isSWF()) {
-// // Work around LHS implicit-this bug in SWF by making
-// // sure each instance has slots defined on it
-// inits.put(key, value);
-// }
+ if (! redeclared) {
+ decls.put(key, value);
+ }
}
}
// mergedAttrs does not deal with our methods
On 2008-03-29, at 14:54 EDT, Henry Minsky wrote:
Tucker, could you check that the change to ClassCompiler makes sense.
Also, that my approach of adding an explicit optional arg to the
destroy method declarations
all over the place is a good idea or not.
Change 20080329-hqm-o by [EMAIL PROTECTED] on 2008-03-29 14:33:23
EDT
in /Users/hqm/openlaszlo/trunk4
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: change to class compiler, declarations of some methods
New Features:
Bugs Fixed:
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
+ add check to ClassCompiler so it doesn't redeclare vars that are
declared in a superclass
+ make signatures match on all destroy() methods in component library
+ make some other methods signature match for checkbox
Tests:
smoke
grid example
test/swf9/checkbox, check that it no longer warns about "frame"
instance var redeclaration in swf9
Files:
A test/swf9/checkbox.lzx
M WEB-INF/lps/schema/lfc.lzx
M WEB-INF/lps/lfc/core/LzNode.lzs
M WEB-INF/lps/lfc/views/LzText.lzs
M WEB-INF/lps/lfc/controllers/LaszloLayout.lzs
M WEB-INF/lps/server/src/org/openlaszlo/compiler/
ClassCompiler.java
M lps/components/lz/list.lzx
M lps/components/utils/layouts/simplelayout.lzx
M lps/components/base/basebutton.lzx
M lps/components/base/basetabelement.lzx
M lps/components/base/basescrollbar.lzx
M lps/components/base/multistatebutton.lzx
M lps/components/base/basetree.lzx
M lps/components/base/basecomponent.lzx
M lps/components/base/basewindow.lzx
M lps/components/base/submit.lzx
M lps/components/base/basetrackgroup.lzx
M lps/components/base/baseformitem.lzx
M lps/components/base/basetabs.lzx
M lps/components/base/basedatacombobox.lzx
M examples/components/grid_example.lzx
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080329-hqm-o.tar