fjgandrade / sharpkit

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

Invalid code generated for nested out parameter #199

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please check // ** ERROR *// in following generated code

C# Code:

    [JsType(JsMode.Prototype, NativeOverloads = false,NativeConstructors = true)]
    public class Foo
    {
        public void test()
        {
            JsNumber b;
            foo1(1, out b);
        }

        public void foo1(JsNumber a, out JsNumber b)
        {
            foo2(1, out b);
        }

    public void foo2(JsNumber a, out JsNumber b)
    {
        b = 2;
    }
    }

generated code:
Foo.prototype.foo1 = function(a,b)
{
    this.foo2(1,b.Value); // ** ERROR *//.
};
Foo.prototype.foo2 = function(a,b)
{
    b.Value = 2;
};
est = function()
{
};
shetab.common.Test.foo = function(file)
{
    var b=new SharpKit.Html.Location();
    b.reload();
    return null;
};

Expected:
b.Value should not be used when passing as out parameter.

Original issue reported on code.google.com by Madnik7@gmail.com on 16 Aug 2012 at 12:47

GoogleCodeExporter commented 9 years ago
Sorry, I put some invalid code, here is generated code

Foo.prototype.test = function()
{
    var b;
    (function()
    {
        b = {Value:b};
        var $res=this.foo1(1,b);
        b = b.Value;
        return $res;
    }).call(this);
};
Foo.prototype.foo1 = function(a,b)
{
    this.foo2(1,b.Value);  // ** ERROR *//
};
Foo.prototype.foo2 = function(a,b)
{
    b.Value = 2;
};

Original comment by Madnik7@gmail.com on 16 Aug 2012 at 12:49

GoogleCodeExporter commented 9 years ago

Original comment by DanelK...@gmail.com on 19 Aug 2012 at 8:28