Not approved.

Question:

1) This only addresses the issue of placement aborting construction.  We also 
have the issue of replication aborting construction.  Is there a similar public 
interface that replication is using that needs similar treatment, so we don't 
need so many checks against __LZdeleted sprinkled throughout the LFC?

Issues:

1) I would rather you use a distinct object than a string for your throw value: 
 Something like:

var __LzConstructAbort = { toString: function () { return 'Constructor Abort'; 
} };

2) If you catch something _other_ than this distinguished object, you should 
re-throw it, so you don't silently ignore errors.  (If the language were more 
powerful, you could ask to only catch your specific throw, but JS is not.)

3) You could simplify the control flow to just:

  if (this.__LZdeleted) { throw __LzConstructAbort; }

right after the placement computation.

On 2010-04-21, at 17:21, Max Carlson wrote:

> Change 20100421-maxcarlson-v by maxcarl...@friendly on 2010-04-21 14:09:52 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-8880 - ERROR @lz/textlistitem.lzx?23: TypeError: Error #1009 
> in swf10, LPP-8929 - Prevent construction of destroyed LzNode subclasses
> 
> Technical Reviewer: [email protected]
> QA Reviewer: ptw
> 
> Details: LzNode - Throw an exception when __LZdeleted is true in 
> LzNode.construct().
> 
> LzInputText, LzText, LaszloView - Remove unneeded __LZdeleted test in 
> construct().
> 
> textlistitem - Remove unneeded test.
> 
> basecomponent - Don't try to set styles for deleted components.
> 
> Tests: See LPP-8880, examples/components/component_sampler.lzx?debug=true in 
> all runtimes
> 
> 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       lps/components/lz/textlistitem.lzx
> M       lps/components/base/basecomponent.lzx
> 
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/20100421-maxcarlson-v.tar
> 


Reply via email to