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; } }
public static object refGet(IRef rf, Context cx) { return rf.Get (cx); }