Example #1
0
 public bool TrySetMember(
     string memberName,
     Object value)
 {
     Operators.SetVariable(Context, null, memberName, ClrObject.WrapDynamic(value));
     return(true);
 }
Example #2
0
 /// <summary>
 /// Specifies dynamic behavior for set operation for static variable
 /// </summary>
 public override bool TrySetMember(
     SetMemberBinder binder,
     Object value
     )
 {
     Operators.SetStaticProperty(type, binder.Name, ClrObject.WrapDynamic(value), null, Context);
     return(true);
 }
Example #3
0
        /// <summary>
        /// Wrap all arguments to Phalanger objects only if the type is not primitive
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        protected static object[] wrapArgs(Object[] args)
        {
            object[] wrappedArgs = new object[args.Length];

            for (int i = 0; i < args.Length; ++i)
            {
                Debug.Assert(!(args[i] is PhpReference));
                wrappedArgs[i] = ClrObject.WrapDynamic(args[i]);
            }
            return(wrappedArgs);
        }