fjgandrade / sharpkit

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

Returning a property set loses the value #344

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The property set value isn't captured when used with a return. This results in 
undefined variables and errors.

        [JsType(JsMode.Clr, Filename = "res/Tester.js")]
        public class PropertyHolder
        {
            public int Prop { get; set; }
        }

        public static int SubMethod()
        {
            var propertyHolder = new PropertyHolder();
            return propertyHolder.Prop = 7;
        }

        public static void PropertyAssignmentValue()
        {
            var assignmentValue = SubMethod();
            new jQuery(HtmlContext.document.body).append(JsContext.@typeof(assignmentValue));
            new jQuery(HtmlContext.document.body).append(JsContext.@typeof(7));
        }

This results in:

        undefined
        number

Which happens due to returning the generated set_Prop function

        SubMethod: function ()
        {
            var propertyHolder = new SharpKitWebApp4.Tester.PropertyHolder.ctor();
            return propertyHolder.set_Prop(7);
        },

/* Generated by SharpKit 5 v5.3.1 */

Original issue reported on code.google.com by co...@gravill.com on 13 Jan 2014 at 4:41

GoogleCodeExporter commented 9 years ago

Original comment by DanelK...@gmail.com on 14 Jan 2014 at 8:55

GoogleCodeExporter commented 9 years ago

Original comment by DanelK...@gmail.com on 13 Mar 2014 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by DanelK...@gmail.com on 13 Mar 2014 at 6:33