On 2010-05-22, at 09:56, André Bargull wrote:

> Not yet approved:
> 
> 1) NodeModel#addHandlerInternal(..):
>> +              "#beginAttribute\n" +
>> +              reference + CompilerUtils.endSourceLocationDirective + 
>> "\n#endAttribute\n);\n" +
>> +              "if ($debug) {\n" +
>> +              "  if (! ($lzc$reference is LzEventable)) {\n" +
>> +              "    Debug.error('Invalid event sender: " + reference + " => 
>> %w (for event " + event + ")', $lzc$reference);\n" +
>> +              "  }\n" +
>> +              "}\n" +
>> +              "return $lzc$reference;\n";
> 
> This is now returning $lzc$reference even if it's not a LzEventable, the 
> previous code just returned undefined.

But only in debug mode.  In non-debug, it just returned the reference.

It seems to me that debug mode should not change the behavior.  You could argue 
that either behavior is correct, but it seems important for the behavior to be 
consistent.  Unless you have a compelling argument to always enforce the type 
(and return undefined when wrong), I think the current implementation is better 
than the previous.

> 2) Conditional expression aren't flattened by the script compiler, only 
> if-else blocks are working.

I'll file an improvement for that.  LPP-9030


Reply via email to