Not approved, these methods didn't compile:

<method name="returnVoid" returns="void">
  for (var s in {}) {
    if (1) return;
  }
</method>

<method name="returnFunction" returns="Function">
  for (var s in {}) {
    if (1) return (function () {});
  }
  return null;
</method>

And labels don't work, but I think that's a different issue:

<!-- only works in non-debug mode -->
<method name="labeledFor" >
  foo: for (var s in {}) {
    if (1) return 1; else break foo;
  }
</method>

<!-- only works in non-debug mode -->
<method name="forInLabeledBlock" >
  foo: {
    for (var s in {}) if (1) return 1; else break foo;
  }
</method>

<!-- doesn't work at all -->
<method name="forInLabeledBlock2" >
  foo: {
    if (0) {}
    for (var s in {}) if (1) return 1; else break foo;
    if (0) {}
  }
</method>

P T Withington wrote:
> Change 20091031-ptw-3 by [email protected] on 2009-10-31 12:20:07 EDT
>     in /Users/ptw/OpenLaszlo/trunk
>     for http://svn.openlaszlo.org/openlaszlo/trunk
>
> Summary: Work around Adobe bug ASC-3852
>
> Bugs Fixed: LPP-8534 SWF10: return from for-in inside try/finally 
> causes verifier error
>
> Technical Reviewer: [email protected] (pending)
> QA Reviewer: [email protected] (pending)
>
> Overview:
>
>     Transform a return out of a for-in that is inside a try block into
>     recording the return value and a flag, breaking from the loop, and
>     a conditional return of that value when you leave the loop (as
>     described in the bug comments).
>
>     Also, some more modularization cleanups to move some of the
>     swf8-specific code generation out of the generic/common paths.
>
> Details:
>
>     JavascriptGenerator, CodeGenerator, CommonGenerator,
>     SWF9Generator, JavascriptCompressor, Translator: Use a factory
>     for making the translation context so subclasses can use custom
>     contexts.
>
>     JavascriptGenerator:  Add visitor that was missed in the 
> remodularization.
>
>     SWF9Generator:  Override visitForInStatement,
>     visitForVarInStatement, visitTryStatement, visitReturnStatement to
>     detect nested try/for-in contexts and rewrite the for-in and
>     return.
>
>     TranslationContext, CodeGenerator: isEnumeration, HashMap, 
> set/getTarget are all
>     only used in CodeGenerator.  clone is unused.
>
> Tests:
>     Smokecheck on all platforms.
>
> Files:
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/CommonGenerator.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9Generator.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/TranslationContext.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptCompressor.java
> M      WEB-INF/lps/server/src/org/openlaszlo/sc/Translator.java
>
> Changeset: 
> http://svn.openlaszlo.org/openlaszlo/patches/20091031-ptw-3.tar
>
_______________________________________________
Laszlo-reviews mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews

Reply via email to