@@ -16,7 +16,8 @@ public PropertyGetterCodeGen(CodeGenerator cg, PropertyBindingInfo bindingInfo)
1616 this . cg = cg ;
1717 this . bindingInfo = bindingInfo ;
1818
19- var caller = this . cg . AppendGetThisCS ( bindingInfo . getMethod , false ) ;
19+ Type callerType ;
20+ var caller = this . cg . AppendGetThisCS ( bindingInfo . getMethod , false , out callerType ) ;
2021
2122 this . cg . cs . AppendLine ( "var ret = {0}.{1};" , caller , bindingInfo . propertyInfo . Name ) ;
2223 var pusher = this . cg . AppendValuePusher ( bindingInfo . propertyType , "ret" ) ;
@@ -40,7 +41,8 @@ public PropertySetterCodeGen(CodeGenerator cg, PropertyBindingInfo propertyBindi
4041
4142 var propertyInfo = this . bindingInfo . propertyInfo ;
4243 var declaringType = propertyInfo . DeclaringType ;
43- var caller = this . cg . AppendGetThisCS ( propertyBindingInfo . setMethod , false ) ;
44+ Type callerType ;
45+ var caller = this . cg . AppendGetThisCS ( propertyBindingInfo . setMethod , false , out callerType ) ;
4446 var propertyType = this . cg . bindingManager . GetCSTypeFullName ( propertyInfo . PropertyType ) ;
4547
4648 this . cg . cs . AppendLine ( "{0} value;" , propertyType ) ;
@@ -54,7 +56,8 @@ public PropertySetterCodeGen(CodeGenerator cg, PropertyBindingInfo propertyBindi
5456 if ( declaringType . IsValueType && ! propertyBindingInfo . setMethod . IsStatic )
5557 {
5658 // 非静态结构体属性修改, 尝试替换实例
57- this . cg . cs . AppendLine ( $ "js_rebind_this(ctx, this_obj, ref { caller } );") ;
59+ var js_rebind_this = this . cg . bindingManager . GetValueOperation ( "js_rebind_this" , callerType ) ;
60+ this . cg . cs . AppendLine ( $ "{ js_rebind_this } (ctx, this_obj, ref { caller } );") ;
5861 }
5962 this . cg . cs . AppendLine ( "return JSApi.JS_UNDEFINED;" ) ;
6063 }
0 commit comments