public void VisitNode (JSDefaultValueLiteral dvl) {
            var parentBoe = ParentNode as JSBinaryOperatorExpression;

            if (CurrentName != "DefaultValue") {
                var thisReferenceType = dvl.GetActualType(TypeSystem);
                if (TypeUtil.IsStruct(thisReferenceType) && (parentBoe != null))
                    Initializations.Add(new InitializationInfo {
                        Type = thisReferenceType,
                        DefaultValueLiteral = dvl,
                        ParentBinaryExpression = parentBoe,
                        BinaryExpressionParent = Stack.Skip(2).First()
                    });
            }

            VisitChildren(dvl);
        }
예제 #2
0
        public void VisitNode (JSDefaultValueLiteral dvl) {
            var literalType = dvl.GetActualType(TypeSystem);
            if (IsLongOrULong(literalType)) {
                JSNode replacement;

                if (literalType.MetadataType == MetadataType.Int64)
                    replacement = GetLongLiteralExpression(0);
                else
                    replacement = GetLongLiteralExpression(0, unsigned: true);

                ParentNode.ReplaceChild(dvl, replacement);
                VisitReplacement(replacement);
                return;
            }

            VisitChildren(dvl);
        }
예제 #3
0
        public void VisitNode(JSDefaultValueLiteral dvl)
        {
            var expectedType = dvl.GetActualType(TypeSystem);

            if (
                IsNullable(expectedType)
                )
            {
                ParentNode.ReplaceChild(
                    dvl, JSLiteral.Null(expectedType)
                    );
            }
            else
            {
                VisitChildren(dvl);
            }
        }
예제 #4
0
        public void VisitNode(JSDefaultValueLiteral dvl)
        {
            var parentBoe = ParentNode as JSBinaryOperatorExpression;

            if (CurrentName != "DefaultValue")
            {
                var thisReferenceType = dvl.GetActualType(TypeSystem);
                if (TypeUtil.IsStruct(thisReferenceType) && (parentBoe != null))
                {
                    Initializations.Add(new InitializationInfo {
                        Type = thisReferenceType,
                        DefaultValueLiteral    = dvl,
                        ParentBinaryExpression = parentBoe,
                        BinaryExpressionParent = Stack.Skip(2).First()
                    });
                }
            }

            VisitChildren(dvl);
        }
예제 #5
0
파일: EmulateInt64.cs 프로젝트: ticuth/JSIL
        public void VisitNode(JSDefaultValueLiteral dvl)
        {
            var literalType = dvl.GetActualType(TypeSystem);

            if (IsLongOrULong(literalType))
            {
                JSNode replacement;

                if (literalType.MetadataType == MetadataType.Int64)
                {
                    replacement = GetLongLiteralExpression(0);
                }
                else
                {
                    replacement = GetLongLiteralExpression(0, unsigned: true);
                }

                ParentNode.ReplaceChild(dvl, replacement);
                VisitReplacement(replacement);
                return;
            }

            VisitChildren(dvl);
        }
예제 #6
0
        public void VisitNode (JSDefaultValueLiteral dvl) {
            var expectedType = dvl.GetActualType(TypeSystem);

            if (
                IsNullable(expectedType)
            ) {
                ParentNode.ReplaceChild(
                    dvl, JSLiteral.Null(expectedType)
                );
            } else {
                VisitChildren(dvl);
            }
        }