demo/typescript.js
function ensureIdentifier(expr, reuseIdentifierExpressions) {
                    if (expr.kind === 69 /* Identifier */ && reuseIdentifierExpressions) {
                        return expr;
                    }
                    var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0);
                    emitCount++;
                    return identifier;
                }
function ensureIdentifier(expr, reuseIdentifierExpressions) {
                    if (expr.kind === 69 /* Identifier */ && reuseIdentifierExpressions) {
                        return expr;
                    }
                    var identifier = emitTempVariableAssignment(expr, canDefineTempVariablesInPlace, emitCount > 0);
                    emitCount++;
                    return identifier;
                }
Ensures that there exists a declared identifier whose value holds the given expression.
This function is useful to ensure that the expression's value can be read from in subsequent expressions.
Unless 'reuseIdentifierExpressions' is false, 'expr' will be returned if it is just an identifier.

@param expr the expression whose value needs to be bound.
@param reuseIdentifierExpressions true if identifier expressions can simply be returned;
false if it is necessary to always emit an identifier.