Partial fix for http://code.google.com/p/google-web-toolkit/issues/detail?id=5707

Modify JsInliner to avoid propagating expressions incorrectly.

in EvaluationOrderVisitor, two changes were made. First of all, a clinit() call
is treated as violating order, the same as any other invocation.

Secondly, a JsNameRef that can be affected by side effects (a global, non-param,
non-local) that is visited when there are still expressions that need evaluation
first, is treated as violating order.

This fixes the showcase issue, but is still insufficient. Side-effect inducing
expressions (assignment, post/prefix increment ops) are still not handled. The
exemption of JsNameRefs that are locals is also insufficient, since a side
effect inducing parameter value may be aliased to the same object as this local.
After your review, I may remove it and just ban any non-param reference from
occuring while there are still params to be evaluated.

I tested this and it seems to fix the problem.

Review by: scottb@google.com

git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@9362 8db76d5a-ed1c-0410-87a9-c151d255dfc7
2 files changed