Exemple #1
0
 void _Visit(JsVariableDeclarator node)
 {
     Literal(node.Name);
     if (node.Initializer != null)
     {
         Operator("=");
         Visit(node.Initializer);
     }
 }
 protected virtual void _visit( JsVariableDeclarator node )
 {
     throw new NotImplementedException( "JsVariableDeclarator" );
 }
 protected override void _visit(JsVariableDeclarator node)
 {
     if (node != null)
     {
         visit(node.Initializer);
     }
 }
        public static JsVariableDeclarator getJsVariableDeclarator(string variableName, JsInvocationExpression initer = null)
        {
            JsVariableDeclarator result = new JsVariableDeclarator();
            result.Name = variableName;

            // should the variable be initialized?
            if (initer != null)
                result.Initializer = initer;

            return result;
        }