src/aria/templates/ClassWriter.js
function (exprStr, statement, errorMsg) {

            var container = this.newVarName();

            // stringify the expression for the eval
            exprStr = this.stringify(exprStr);
            this.writeln("var " + container + " = null;");
            this.writeln("try {");
            this.increaseIndent();
            // remove quotes
            exprStr = exprStr.substr(1, exprStr.length - 2);
            this.writeln('eval( "' + container + '=(' + exprStr + ')" );');
            this.decreaseIndent();
            this.writeln("} catch (e) {");
            this.increaseIndent();
            this.writeln("this.$logError(", errorMsg, ",[\"", exprStr, "\",__filename,", statement.lineNumber, ",", this.stringify(statement.name), "], e);");
            this.decreaseIndent();
            this.writeln("}");

            return container;
        }
function (exprStr, statement, errorMsg) {

            var container = this.newVarName();

            // stringify the expression for the eval
            exprStr = this.stringify(exprStr);
            this.writeln("var " + container + " = null;");
            this.writeln("try {");
            this.increaseIndent();
            // remove quotes
            exprStr = exprStr.substr(1, exprStr.length - 2);
            this.writeln('eval( "' + container + '=(' + exprStr + ')" );');
            this.decreaseIndent();
            this.writeln("} catch (e) {");
            this.increaseIndent();
            this.writeln("this.$logError(", errorMsg, ",[\"", exprStr, "\",__filename,", statement.lineNumber, ",", this.stringify(statement.name), "], e);");
            this.decreaseIndent();
            this.writeln("}");

            return container;
        }
function ( exprStr , statement , errorMsg ) { var container = this . newVarName ( ) ; // stringify the expression for the eval exprStr = this . stringify ( exprStr ) ; this . writeln ( "var " + container + " = null;" ) ; this . writeln ( "try {" ) ; this . increaseIndent ( ) ; // remove quotes exprStr = exprStr . substr ( 1 , exprStr . length - 2 ) ; this . writeln ( 'eval( "' + container + '=(' + exprStr + ')" );' ) ; this . decreaseIndent ( ) ; this . writeln ( "} catch (e) {" ) ; this . increaseIndent ( ) ; this . writeln ( "this.$logError(" , errorMsg , ",[\"" , exprStr , "\",__filename," , statement . lineNumber , "," , this . stringify ( statement . name ) , "], e);" ) ; this . decreaseIndent ( ) ; this . writeln ( "}" ) ; return container ; }
Wrap an expression evaluation in a try catch and return result
@param {String} exprStr String to be eval'ed
@param {aria.templates.TreeBeans:Statement} statement Statement corresponding to the expression
@param {String} errorMsg Message to be logged in case of errors
@return {String} container the name of the variable that will contain the expression
Wrap an expression evaluation in a try catch and return result