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); }
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); }
public void VisitNode(JSDefaultValueLiteral dvl) { var expectedType = dvl.GetActualType(TypeSystem); if ( IsNullable(expectedType) ) { ParentNode.ReplaceChild( dvl, JSLiteral.Null(expectedType) ); } else { VisitChildren(dvl); } }
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); }
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); }
public void VisitNode (JSDefaultValueLiteral dvl) { var expectedType = dvl.GetActualType(TypeSystem); if ( IsNullable(expectedType) ) { ParentNode.ReplaceChild( dvl, JSLiteral.Null(expectedType) ); } else { VisitChildren(dvl); } }