Beispiel #1
0
            public Assignment(
                NodeIndices parentNodeIndices, int statementIndex, int nodeIndex,
                string target, JSExpression newValue,
                JSOperator @operator,
                TypeReference targetType, TypeReference sourceType
                ) : base(parentNodeIndices, statementIndex, nodeIndex)
            {
                Target   = target;
                NewValue = newValue;

                var newVariable = newValue as JSVariable;

                if (newVariable != null)
                {
                    SourceVariable = newVariable.Identifier;
                }
                else
                {
                    SourceVariable = null;
                }

                SourceType   = sourceType;
                TargetType   = targetType;
                Operator     = @operator;
                IsConversion = !TypeUtil.TypesAreEqual(targetType, sourceType);
            }
Beispiel #2
0
 public Assignment(
     int[] parentNodeIndices, int statementIndex, int nodeIndex,
     JSVariable target, JSExpression newValue,
     JSOperator @operator,
     TypeReference targetType, TypeReference sourceType
     ) : base(parentNodeIndices, statementIndex, nodeIndex)
 {
     Target         = target;
     NewValue       = newValue;
     SourceVariable = newValue as JSVariable;
     SourceType     = sourceType;
     TargetType     = targetType;
     Operator       = @operator;
     IsConversion   = !TypeUtil.TypesAreEqual(targetType, sourceType);
 }