Change 20100421-maxcarlson-B by maxcarl...@friendly on 2010-04-21 16:42:17 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Update basecomponent to not set styles, construct() to automatically
halt for deleted nodes
Bugs Fixed: LPP-8929 - Prevent construction of destroyed LzNode subclasses
Technical Reviewer: [email protected]
QA Reviewer: ptw
Details: Broke into separate changesets, updated to address Andre's issues:
2) strict equality check to avoid string coercion, re-throw error if e !===
'__LZdeleted'!
> + } catch(e) {
> + // Construct may, through many tangled webs of replication and
> + // placement, actually end up deleting us! Bail out completely.
> + if (e == '__LZdeleted') {
> + return;
> + }
> + }
Fixed.
3) There's an important devnote right before the added "throw('__LZdeleted');":
> // @devnote only add to subnodes if this node is not deleted which
> // may happen as a side-effect of calling determinePlacement().
> // We still need to set 'immediateparent' because legacy constructors
> // expect to see this property.
I moved the throw() after this, just to be safe.
LzNode - Throw a custom exception when a node is deleted due to placement
changes to halt any superclass construct() calls. Catch exceptions in
construct() and forward if they're not our custom __LZdeleted exception.
LzInputText, LzText, LaszloView - Remove unneeded __LZdeleted test in
construct().
LzDatapath - Remove extra test for onDocumentChange.ready
Tests: See examples/components/component_sampler.lzx?debug=true in all
runtimes, smoke
Files:
M WEB-INF/lps/lfc/core/LzNode.lzs
M WEB-INF/lps/lfc/views/LzInputText.lzs
M WEB-INF/lps/lfc/views/LzText.lzs
M WEB-INF/lps/lfc/views/LaszloView.lzs
M WEB-INF/lps/lfc/data/LzDatapath.lzs
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/20100421-maxcarlson-B.tar