Пример #1
0
        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);
                    }
                }
            }
        }
Пример #2
0
        /// <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 ();
        }
Пример #3
0
 public override void EmitStatementJs(JsEmitContext jec)
 {
     jec.Buf.Write("\t", Location);
     Target.EmitJs(jec);
     jec.Buf.Write(" = ");
     Source.EmitJs(jec);
     jec.Buf.Write(";\n");
 }
Пример #4
0
        public virtual void EmitJs()
        {
            jec = new JsEmitContext(module);

            jec.Buf.Write("// Module: ", this.Name, ".js\n");

            module.EmitContainerJs(jec);
        }
Пример #5
0
        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;
            }
        }
Пример #6
0
        public override void EmitJs(JsEmitContext jec)
        {
            jec.Buf.Write("[", Location);

            bool first = true;

            foreach (var elem in Elements)
            {
                if (!first)
                {
                    jec.Buf.Write(", ");
                }
                elem.EmitJs(jec);
                first = false;
            }

            jec.Buf.Write("]");
        }
Пример #7
0
        public override void EmitJs(JsEmitContext jec)
        {
            jec.Buf.Write("{", Location);

            bool first = true;

            foreach (ElementInitializer elem in Elements)
            {
                if (!first)
                {
                    jec.Buf.Write(", ");
                }
                jec.Buf.Write("\"", elem.Name, "\":");
                elem.Source.EmitJs(jec);
                first = false;
            }

            jec.Buf.Write("}");
        }
Пример #8
0
 public override void EmitJs(JsEmitContext jec)
 {
     jec.Buf.Write(GetValue() as String, Location);
 }
Пример #9
0
 public override void EmitJs(JsEmitContext jec)
 {
     jec.Buf.Write("new ", Location);
     Expr.EmitJs(jec);
 }
Пример #10
0
 public override void EmitJs(JsEmitContext jec)
 {
     DoEmitJs(jec);
 }
Пример #11
0
 protected override void DoEmitJs(JsEmitContext jec)
 {
     expr.EmitJs(jec);
 }
Пример #12
0
 public override void EmitJs(JsEmitContext jec)
 {
     jec.Buf.Write("undefined", Location);
 }
Пример #13
0
 public override void EmitJs(JsEmitContext jec)
 {
     Expr.EmitJs(jec);
     jec.Buf.Write(" in ");
     ObjectExpression.EmitJs(jec);
 }
Пример #14
0
 public override void EmitJs(JsEmitContext jec)
 {
     Arguments[0].Expr.EmitJs(jec);
     jec.Buf.Write(".", name, Location);
 }
Пример #15
0
 public override void EmitJs(JsEmitContext jec)
 {
     child.EmitJs(jec);
 }
Пример #16
0
 public override void EmitJs(JsEmitContext jec)
 {
     Target.EmitJs(jec);
     jec.Buf.Write(" = ");
     Source.EmitJs(jec);
 }
Пример #17
0
 public override void EmitJs(JsEmitContext jec)
 {
     jec.Buf.Write("\"", jec.Buf.EscapeString(Value), "\"", loc);
 }