本文整理汇总了C#中EcmaScript.NET.Node.removeChild方法的典型用法代码示例。如果您正苦于以下问题:C# Node.removeChild方法的具体用法?C# Node.removeChild怎么用?C# Node.removeChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EcmaScript.NET.Node
的用法示例。
在下文中一共展示了Node.removeChild方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateUnary
/// <summary> Unary</summary>
internal Node CreateUnary(int nodeType, Node child)
{
int childType = child.Type;
switch (nodeType) {
case Token.DELPROP: {
Node n;
if (childType == Token.NAME) {
// Transform Delete(Name "a")
// to Delete(Bind("a"), String("a"))
child.Type = Token.BINDNAME;
Node left = child;
Node right = Node.newString (child.String);
n = new Node (nodeType, left, right);
}
else if (childType == Token.GETPROP || childType == Token.GETELEM) {
Node left = child.FirstChild;
Node right = child.LastChild;
child.removeChild (left);
child.removeChild (right);
n = new Node (nodeType, left, right);
}
else if (childType == Token.GET_REF) {
Node rf = child.FirstChild;
child.removeChild (rf);
n = new Node (Token.DEL_REF, rf);
}
else {
n = new Node (Token.TRUE);
}
return n;
}
case Token.TYPEOF:
if (childType == Token.NAME) {
child.Type = Token.TYPEOFNAME;
return child;
}
break;
case Token.BITNOT:
if (childType == Token.NUMBER) {
int value = ScriptConvert.ToInt32 (child.Double);
child.Double = ~value;
return child;
}
break;
case Token.NEG:
if (childType == Token.NUMBER) {
child.Double = -child.Double;
return child;
}
break;
case Token.NOT: {
int status = isAlwaysDefinedBoolean (child);
if (status != 0) {
int type;
if (status == ALWAYS_TRUE_BOOLEAN) {
type = Token.FALSE;
}
else {
type = Token.TRUE;
}
if (childType == Token.TRUE || childType == Token.FALSE) {
child.Type = type;
return child;
}
return new Node (type);
}
break;
}
}
return new Node (nodeType, child);
}