Test whether the given tree is a standard JS expression.
Test whether the given tree is a pure standard JS expression.
Test whether the given tree is a side-effect-free standard JS expression.
Push an lhs into a (potentially complex) rhs lhs can be either a EmptyTree, a VarDef, a Assign or a Return
Desugar an expression of Extended-JS into ES5 JS
Desugar an expression of Extended-JS into ES5 JS
Desugar a statement of Extended-JS into ES5 JS
Desugar a statement of Extended-JS into ES5 JS
Same as above, for one head argument and a list of arguments
Same as above, for two arguments
Same as above, for a single argument
Unnest complex constructs in argument position in temporary variables
Unnest complex constructs in argument position in temporary variables
If all the arguments are JS expressions, there is nothing to do.
Any argument that is not a JS expression must be unnested and stored
in a temporary variable before the statement produced by makeStat
.
But *this changes the evaluation order!* In order not to lose it, it is necessary to also unnest arguments that are expressions but that are supposed to be evaluated before the argument-to-be-unnested and could have side-effects or even whose evaluation could be influenced by the side-effects of another unnested argument.
Without deep effect analysis, which we do not do, we need to take
a very pessimistic approach, and unnest any expression that contains
an identifier (except those after the last non-expression argument).
Hence the predicate isPureExpressionWithoutIdent
.