Change bargull-20110406-rsz by bargull@Bargull02 on 2011-04-06 17:20:38
in /home/anba/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Remove stale "undefined reference checker" code in
JavascriptGenerator
Bugs Fixed: LPP-9874 (Broken "undefined reference checker" code in
JavascriptGenerator produces excessive try-catch blocks)
Technical Reviewer: ptw
QA Reviewer: (pending)
Details:
JavascriptGenerator:
- checkUndefinedFunction() and checkUndefinedMethod() are no longer
used, can be removed safely to reduce maintenance overhead
- visitPrefixExpression(), visitPostfixExpression() and
visitAssignmentExpression() expanded the code if free references are
present to support the "undefined reference checker", but the "undefined
reference checker" is merely a leftover from CodeGenerator and not
actually implemented in JavascriptGenerator, therefore the complete code
expansion is not necessary (anymore)
- XfixInstrs and AssignOpTable are only support maps and now no longer
used -> removed
- identifierPattern, another unused variable -> removed
- translateReferenceForCall(SimpleNode) was never called -> removed
- translateReferenceForCall(SimpleNode,boolean,SimpleNode) removed
outcommented code
- visitUnaryExpression(), removed ASTPropertyValueReference and
ASTPropertyIdentifierReference from whitelist for "typeof" operator,
only ASTIdentifier is important for "typeof". The other two ast types
are only necessary for swf8, consider "typeof ({}).foo" which shouldn't
emit an undefined reference warning
JavascriptGenerator$JavascriptReference:
- removed referenceCount argument of constructor -> not used, swf8-specific
ParseTreePrinter:
- don't call maybeAddParens() for second child of
ASTPropertyIdentifierReference, because the second child is _always_ an
ASTIdentifier and maybeAddParens() is a no-op for ASTIdentifier
Tests:
smokecheck x (dhtml,swf10)
Files:
M WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
Changeset:
http://svn.openlaszlo.org/openlaszlo/patches/bargull-20110406-rsz.tar