本文整理汇总了C#中JSIL.Ast.JSVariable.GetActualType方法的典型用法代码示例。如果您正苦于以下问题:C# JSVariable.GetActualType方法的具体用法?C# JSVariable.GetActualType怎么用?C# JSVariable.GetActualType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSIL.Ast.JSVariable
的用法示例。
在下文中一共展示了JSVariable.GetActualType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EliminateVariable
protected void EliminateVariable (JSNode context, JSVariable variable, JSExpression replaceWith, QualifiedMemberIdentifier method) {
{
var replacer = new VariableEliminator(
variable,
JSChangeTypeExpression.New(replaceWith, variable.GetActualType(TypeSystem), TypeSystem)
);
replacer.Visit(context);
}
{
var replacer = new VariableEliminator(variable, replaceWith);
var assignments = (from a in FirstPass.Assignments where
variable.Equals(a.NewValue) ||
a.NewValue.SelfAndChildrenRecursive.Any(variable.Equals)
select a).ToArray();
foreach (var a in assignments) {
if (!variable.Equals(a.NewValue))
replacer.Visit(a.NewValue);
}
}
Variables.Remove(variable.Identifier);
FunctionSource.InvalidateFirstPass(method);
}
示例2: EliminateVariable
protected void EliminateVariable(JSNode context, JSVariable variable, JSExpression replaceWith, QualifiedMemberIdentifier method)
{
{
var replacer = new VariableEliminator(
variable,
JSChangeTypeExpression.New(replaceWith, TypeSystem, variable.GetActualType(TypeSystem))
);
replacer.Visit(context);
}
{
var replacer = new VariableEliminator(variable, replaceWith);
var assignments = (from a in FirstPass.Assignments where
variable.Equals(a.NewValue) ||
a.NewValue.SelfAndChildrenRecursive.Any((_n) => variable.Equals(_n))
select a).ToArray();
foreach (var a in assignments) {
if (variable.Equals(a.NewValue)) {
FirstPass.Assignments.Remove(a);
FirstPass.Assignments.Add(
new FunctionAnalysis1stPass.Assignment(
a.StatementIndex, a.NodeIndex,
a.Target, replaceWith, a.Operator,
a.TargetType, a.SourceType
)
);
} else {
replacer.Visit(a.NewValue);
}
}
}
Variables.Remove(variable.Identifier);
FunctionSource.InvalidateFirstPass(method);
}