mgusmano / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

Some compound assignment operators on properties generate wrong code #146

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
namespace SharpKitWebApp1
{
    [JsType(JsMode.Global, Filename = "res/Default.js")]
    public class main : HtmlContext
    {
        public static void go()
        {
            Holder holder = new Holder();

            holder.Data += 1;
            holder.Data -= 1;
            holder.Data /= 1;
            holder.Data *= 1;
        }
    }

    [JsType(JsMode.Clr, Filename = "res/Default.js")]
    public class Holder
    {
        public int Data { get; set; }
    }
}

The addition assignment operator works, then the others fail at runtime with 
"Uncaught ReferenceError: Invalid left-hand side in assignment".

The JS shows the issue

/*Generated by SharpKit 5 v4.28.0000*/
function go()
{
    var holder=new SharpKitWebApp1.Holder.ctor();
    holder.set_Data(holder.get_Data() + 1);
    holder.get_Data() -= 1;
    holder.get_Data() /= 1;
    holder.get_Data() *= 1;
};

Original issue reported on code.google.com by co...@gravill.com on 15 Jun 2012 at 10:18

GoogleCodeExporter commented 8 years ago

Original comment by DanelK...@gmail.com on 15 Jun 2012 at 10:19

GoogleCodeExporter commented 8 years ago

Original comment by DanelK...@gmail.com on 15 Jun 2012 at 10:27