예제 #1
0
 public void SetFunction(ASBinCode.rtData.rtFunction rtFunction, RunTimeValueBase thisobj)
 {
     function.CopyFrom(rtFunction);
     if (thisobj != null)
     {
         function.setThis(thisobj);
     }
 }
예제 #2
0
        public override bool directSet(RunTimeValueBase value)
        {
            if (isConstMember)
            {
                if (!flaghasset)
                {
                    flaghasset = true;
                }
                else
                {
                    return(false);
                }
            }

            base.directSet(value);
            if (value.rtType == RunTimeDataType.rt_function)
            {
                ASBinCode.rtData.rtFunction function = (ASBinCode.rtData.rtFunction)getValue();

                if (function.this_pointer == null || !function.ismethod)
                {
                    function.setThis(obj);
                }
            }
            else if (obj.objScope != null && value.rtType == FunctionClassRtType)
            {
                ASBinCode.rtData.rtFunction function = (ASBinCode.rtData.rtFunction)
                                                       TypeConverter.ObjectImplicit_ToPrimitive((ASBinCode.rtData.rtObjectBase)value);

                if (function.this_pointer == null || !function.ismethod)
                {
                    function.setThis(obj);
                }
            }

            return(true);
        }