protected JsExpressionStatement getCachedFileExpressionStatement( string arrayName, string fileName, string fileUri )
        {
            JsMemberExpression leftPref = AstUtils.getNewMemberExpression(fileName);

            JsAssignmentExpression newAssignment = new JsAssignmentExpression();

            string assoKey = arrayName + "[ '" + fileUri + "' ]";
            newAssignment.Left = AstUtils.getNewMemberExpression(assoKey, leftPref);
            newAssignment.Right = AstUtils.getCachedHtmlExpression(fileUri); ;

            JsExpressionStatement newStatement = new JsExpressionStatement();
            newStatement.Expression = newAssignment;
            return newStatement;
        }
        public JsExpressionStatement getInjectionPointsExpression()
        {
            if (cSharpDef != null)
            {
                JsAssignmentExpression newAssignment = new JsAssignmentExpression();

                // since this is static, prepend the class path.
                JsMemberExpression leftPref = AstUtils.getNewMemberExpression(cSharpDef.FullName);

                //shouldExcludeBasedOnNamespace;
                newAssignment.Left = AstUtils.getNewMemberExpression(OutputNameConstants.PROPERTY_INJECTION_POINTS, leftPref);
                newAssignment.Right = getInjectionPointsFunction( cSharpDef );

                JsExpressionStatement newStatement = new JsExpressionStatement();
                newStatement.Expression = newAssignment;
                return newStatement;
            }

            return null;
        }
 protected virtual void _visit( JsAssignmentExpression node )
 {
     throw new NotImplementedException( "JsAssignmentExpression" );
 }
        protected JsUnit getHtmlFileList(string fileName, List<string> fileList)
        {
            JsUnit result = AstUtils.getNewJsUnit();

            JsAssignmentExpression newAssignment = new JsAssignmentExpression();

            // since this is static, prepend the class path.
            JsMemberExpression leftPref = AstUtils.getNewMemberExpression(fileName);

            //shouldExcludeBasedOnNamespace;
            newAssignment.Left = AstUtils.getNewMemberExpression(OutputNameConstants.FUNCTION_GET_CACHED_FILE_LIST, leftPref);
            newAssignment.Right = getHtmlFileListFunction(fileList);

            JsExpressionStatement newStatement = new JsExpressionStatement();
            newStatement.Expression = newAssignment;
            result.Statements.Add(newStatement);

            return result;
        }
        protected JsUnit getFunctionCachedHtmlForUri(string fileName, List<string> fileList)
        {
            JsUnit result = AstUtils.getNewJsUnit();

            // since this is static, prepend the class path.
            JsMemberExpression leftPref = AstUtils.getNewMemberExpression(fileName);

            JsAssignmentExpression newAssignment = new JsAssignmentExpression();
            newAssignment.Left = AstUtils.getNewMemberExpression(OutputNameConstants.FUNCTION_GET_CACHED_HTML_FOR_URI, leftPref);
            newAssignment.Right = getCachedHtmlFileFunction(OutputNameConstants.PROPERTY_HTML_MERGED_FILES);

            JsExpressionStatement newStatement = new JsExpressionStatement();
            newStatement.Expression = newAssignment;
            result.Statements.Add(newStatement);

            return result;
        }
 protected override void _visit(JsAssignmentExpression node)
 {
     if (node != null)
     {
         visit(node.Left);
         visit(node.Right);
     }
 }
 public static JsAssignmentExpression getJsAssignmentStatement(JsExpression leftExp, string operatorStr, JsExpression rightExp)
 {
     JsAssignmentExpression result = new JsAssignmentExpression();
     result.Left = leftExp;
     result.Operator = operatorStr;
     result.Right = rightExp;
     return result;
 }
Example #8
0
 public static JsAssignmentExpression Assign(this JsExpression me, JsExpression exp2)
 {
     var node = new JsAssignmentExpression { Left = me, Right = exp2 };
     return node;
 }
        public JsExpressionStatement getDependencyExpression()
        {
            if (cSharpDef != null)
            {
                JsAssignmentExpression newAssignment = new JsAssignmentExpression();
                newAssignment.Operator = "=";

                // since this is static, prepend the class path.
                JsMemberExpression leftPref = AstUtils.getNewMemberExpression(cSharpDef.FullName);

                //shouldExcludeBasedOnNamespace;
                newAssignment.Left = AstUtils.getNewMemberExpression(OutputNameConstants.FUNCTION_GET_CLASS_DEPENDENCIES, leftPref);
                newAssignment.Right = getClassDependencyFunction(jsEntity);

                JsExpressionStatement newStatement = new JsExpressionStatement();
                newStatement.Expression = newAssignment;
                return newStatement;
            }

            return null;
        }