本文整理汇总了C#中Mono.CSharp.JavaScript.JsEmitContext类的典型用法代码示例。如果您正苦于以下问题:C# JsEmitContext类的具体用法?C# JsEmitContext怎么用?C# JsEmitContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JsEmitContext类属于Mono.CSharp.JavaScript命名空间,在下文中一共展示了JsEmitContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmitJs
public override void EmitJs (JsEmitContext jec)
{
CheckExternImpl ();
base.EmitJs (jec);
}
示例2: EmitStatementJs
public override void EmitStatementJs (JsEmitContext jec)
{
// It can be null for static initializers
if (base_ctor == null || base_ctor.DeclaringType == jec.Compiler.BuiltinTypes.Object)
return;
jec.Buf.Write ("\t", Location);
EmitJs (jec);
jec.Buf.Write (";\n");
}
示例3: EmitJs
public void EmitJs (TypeDefinition parent, JsEmitContext jec)
{
var mc = (IMemberContext) method;
method.ParameterInfo.ApplyAttributes (mc, MethodBuilder);
ToplevelBlock block = method.Block;
if (block != null) {
BlockContext bc = new BlockContext (mc, block, method.ReturnType);
if (block.Resolve (null, bc, method)) {
block.EmitBlockJs (jec, false, false);
}
}
}
示例4: EmitJs
public override void EmitJs (JsEmitContext jec)
{
var typeName = jec.MakeJsTypeName(this.Parent.MemberName.Name);
var proto = "";
if ((ModFlags & Modifiers.STATIC) == 0) {
proto = ".prototype";
}
jec.Buf.Write ("\tObject.defineProperty(", typeName, proto, ", \"", MemberName.Name, "\", {\n", Location);
jec.Buf.Indent ();
if (this.Get != null) {
this.Get.EmitJs (jec);
}
if (this.Set != null) {
this.Set.EmitJs (jec);
}
jec.Buf.Write ("\tenumerable: true,\n\tconfigurable: true\n");
jec.Buf.Unindent ();
jec.Buf.Write ("\t});\n");
}
示例5: EmitJs
public override void EmitJs (JsEmitContext jec)
{
child.EmitJs (jec);
}
示例6: EmitJs
public override void EmitJs (JsEmitContext jec)
{
jec.Buf.Write ("undefined", Location);
}
示例7: DoEmitJs
protected override void DoEmitJs (JsEmitContext jec)
{
expr.EmitJs (jec);
}
示例8: EmitJs
public override void EmitJs (JsEmitContext jec)
{
Arguments[0].Expr.EmitJs (jec);
jec.Buf.Write (".", name, Location);
}
示例9: EmitJs
/// <summary>
/// Base JS emit method. This is also entry point for CLS-Compliant verification.
/// </summary>
public virtual void EmitJs (JsEmitContext jec)
{
if (!Compiler.Settings.VerifyClsCompliance)
return;
VerifyClsCompliance ();
}
示例10: EmitContainerJs
public override void EmitContainerJs (JsEmitContext jec)
{
jec.Buf.Write ("// File: ", this.FileName, "\n");
base.EmitContainerJs (jec);
}
示例11: EmitStatementJs
public override void EmitStatementJs (JsEmitContext jec)
{
jec.Buf.Write ("\t", Location);
Target.EmitJs (jec);
jec.Buf.Write (" = ");
Source.EmitJs (jec);
jec.Buf.Write (";\n");
}
示例12: EmitJs
public virtual void EmitJs (JsEmitContext jec)
{
bool first = true;
foreach (Argument a in args) {
if (!first)
jec.Buf.Write(", ");
a.Expr.EmitJs (jec);
first = false;
}
}
示例13: EmitContainerJs
public override void EmitContainerJs (JsEmitContext jec)
{
if (OptAttributes != null)
OptAttributes.EmitJs (jec);
foreach (var tc in containers) {
tc.PrepareEmit ();
}
base.EmitContainerJs (jec);
if (Compiler.Report.Errors == 0 && !Compiler.Settings.WriteMetadataOnly)
VerifyMembers ();
if (anonymous_types != null) {
foreach (var atypes in anonymous_types)
foreach (var at in atypes.Value)
at.EmitContainerJs (jec);
}
}
示例14: EmitJs
public override void EmitJs (JsEmitContext jec)
{
jec.Buf.Write ("\"", jec.Buf.EscapeString(Value), "\"", loc);
}
示例15: EmitContainerJs
public virtual void EmitContainerJs (JsEmitContext jec)
{
if (containers != null) {
for (int i = 0; i < containers.Count; ++i)
containers[i].EmitContainerJs (jec);
}
}