mgusmano / sharpkit

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

ExtJs mode: static fields initialization is incorrect #111

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Add the class into a project:

[JsType(JsMode.ExtJs)]
public class test
{
    public static int V = 123;
}

Build the project.

Generated code looks like:

Ext.define("test",
{
    statics:
    {
        cctor:function()
        {
            test.V = 123;
        }
    },
    constructor:function()
    {
    }
});

As result test.V returns undefined.

The expected code is:

Ext.define("test",
{
    statics:
    {
        V: 123
    },
    constructor:function()
    {
    }
});

SharpKit version 4.24.6000.

Original issue reported on code.google.com by tetk...@mail.ru on 25 Mar 2012 at 8:00

GoogleCodeExporter commented 8 years ago
Use this code:

    [JsType(JsMode.ExtJs, InlineFields=true)]
    public class test
    {
        public static int V = 123;
    }

InlineFields will be made true by default in the future (backward compatibility)

Original comment by DanelK...@gmail.com on 6 May 2012 at 2:02