示例#1
0
 public void Visit(ConditionalCompilationElseIf node)
 {
     // invalid! ignore
     IsValid = false;
 }
 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
                 }
             }
         }
     }
 }
示例#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
 }
示例#10
0
 public void Visit(ConditionalCompilationElseIf node)
 {
     // nothing to do
 }