未验证 提交 439808d6 编写于 作者: J Julien Couvreur 提交者: GitHub

Merge pull request #31914 from Meir017/cleanup-generated-code

use more nameof keyword for generate code
......@@ -743,7 +743,7 @@ private void WriteGreenFactory(Node nd, bool withSyntaxFactoryContext = false)
}
WriteLine(" break;");
WriteLine(" default:");
WriteLine(" throw new ArgumentException(\"kind\");");
WriteLine(" throw new ArgumentException(nameof(kind));");
WriteLine(" }");
}
......@@ -779,7 +779,7 @@ private void WriteGreenFactory(Node nd, bool withSyntaxFactoryContext = false)
}
WriteLine(" break;");
WriteLine(" default:");
WriteLine(" throw new ArgumentException(\"{0}\");", pname);
WriteLine(" throw new ArgumentException(nameof({0}));", pname);
WriteLine(" }");
if (IsOptional(field))
{
......@@ -1747,7 +1747,7 @@ private void WriteRedFactory(Node nd)
}
WriteLine(" break;");
WriteLine(" default:");
WriteLine(" throw new ArgumentException(\"kind\");");
WriteLine(" throw new ArgumentException(nameof(kind));");
WriteLine(" }");
}
......@@ -1773,7 +1773,7 @@ private void WriteRedFactory(Node nd)
}
WriteLine(" break;");
WriteLine(" default:");
WriteLine(" throw new ArgumentException(\"{0}\");", pname);
WriteLine(" throw new ArgumentException(nameof({0}));", pname);
WriteLine(" }");
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册