Exemplo n.º 1
0
 public void Visit(ConditionalCompilationElseIf node)
 {
     // invalid! ignore
     IsValid = false;
 }
Exemplo n.º 2
0
 public void Visit(ConditionalCompilationElseIf node)
 {
     // preprocessor nodes are handled outside the real JavaScript parsing
 }
 public void Visit(ConditionalCompilationElseIf node)
 {
     // invalid! ignore
     IsValid = false;
 }
 private void DoConditionalCompilationElseIf(ConditionalCompilationElseIf node)
 {
     if (m_parser.Settings.IsModificationAllowed(TreeModifications.EvaluateNumericExpressions))
     {
         // if the if-condition is a constant, we can eliminate one of the two branches
         ConstantWrapper constantCondition = node.Condition as ConstantWrapper;
         if (constantCondition != null)
         {
             // instead, replace the condition with a 1 if it's always true or a 0 if it's always false
             if (constantCondition.IsNotOneOrPositiveZero)
             {
                 try
                 {
                     node.Condition =
                         new ConstantWrapper(constantCondition.ToBoolean() ? 1 : 0, PrimitiveType.Number, node.Condition.Context, m_parser);
                 }
                 catch (InvalidCastException)
                 {
                     // ignore any invalid cast exceptions
                 }
             }
         }
     }
 }
Exemplo n.º 5
0
 public void Visit(ConditionalCompilationElseIf node)
 {
     // not applicable; terminate
 }
        public override void Visit(ConditionalCompilationElseIf node)
        {
            if (node != null)
            {
                // depth-first
                base.Visit(node);

                DoConditionalCompilationElseIf(node);
            }
        }
 public void Visit(ConditionalCompilationElseIf node)
 {
     // nothing to do
 }
 public void Visit(ConditionalCompilationElseIf node)
 {
     // preprocessor nodes are handled outside the real JavaScript parsing
 }
 public void Visit(ConditionalCompilationElseIf node)
 {
     // not applicable; terminate
 }
Exemplo n.º 10
0
 public void Visit(ConditionalCompilationElseIf node)
 {
     // nothing to do
 }