Пример #1
0
 public static object refSet(IRef rf, object value, Context cx)
 {
     return rf.Set (cx, value);
 }
Пример #2
0
 public static object refIncrDecr(IRef rf, Context cx, int incrDecrMask)
 {
     object value = rf.Get (cx);
     bool post = ((incrDecrMask & Node.POST_FLAG) != 0);
     double number;
     if (CliHelper.IsNumber (value)) {
         number = Convert.ToDouble (value);
     }
     else {
         number = ScriptConvert.ToNumber (value);
         if (post) {
             // convert result to number
             value = number;
         }
     }
     if ((incrDecrMask & Node.DECR_FLAG) == 0) {
         ++number;
     }
     else {
         --number;
     }
     rf.Set (cx, number);
     if (post) {
         return value;
     }
     else {
         return number;
     }
 }