示例#1
0
        protected override JavaScriptObject Execute(SourcePosition pos, Scope scope, JavaScriptObject thisObject)
        {
            JavaScriptInteger sleeptime = scope.GetVariable("milliseconds", pos).ToInteger();

            Thread.Sleep(sleeptime.Value);
            return(sleeptime);
        }
示例#2
0
 public IntegerNode(SourcePosition pos, int number)
     : base(pos)
 {
     this.number = new JavaScriptInteger(number);
 }
示例#3
0
        public override int CompareTo(JavaScriptObject obj)
        {
            JavaScriptInteger number = (JavaScriptInteger)obj;

            return(value.CompareTo(number.value));
        }
示例#4
0
 public JavaScriptInteger Power(JavaScriptInteger n)
 {
     return(new JavaScriptInteger(Convert.ToInt32(Math.Pow(value, n.value))));
 }
示例#5
0
 public JavaScriptInteger Remainder(JavaScriptInteger divisor)
 {
     return(new JavaScriptInteger(value % divisor.value));
 }
示例#6
0
 public JavaScriptInteger Divide(JavaScriptInteger divisor)
 {
     return(new JavaScriptInteger(value / divisor.value));
 }
示例#7
0
 public JavaScriptInteger Multiply(JavaScriptInteger multiplicand)
 {
     return(new JavaScriptInteger(value * multiplicand.value));
 }
示例#8
0
 public JavaScriptInteger Subtract(JavaScriptInteger subtrahend)
 {
     return(new JavaScriptInteger(value - subtrahend.value));
 }
示例#9
0
 public JavaScriptInteger Add(JavaScriptInteger augend)
 {
     return(new JavaScriptInteger(value + augend.value));
 }
示例#10
0
 public JavaScriptInteger Multiply(JavaScriptInteger multiplicand)
 {
     return new JavaScriptInteger(value * multiplicand.value);
 }
示例#11
0
 public JavaScriptInteger Divide(JavaScriptInteger divisor)
 {
     return new JavaScriptInteger(value / divisor.value);
 }
示例#12
0
 public JavaScriptInteger Add(JavaScriptInteger augend)
 {
     return new JavaScriptInteger(value + augend.value);
 }
示例#13
0
 public JavaScriptInteger Subtract(JavaScriptInteger subtrahend)
 {
     return new JavaScriptInteger(value - subtrahend.value);
 }
示例#14
0
 public JavaScriptInteger Remainder(JavaScriptInteger divisor)
 {
     return new JavaScriptInteger(value % divisor.value);
 }
示例#15
0
 public JavaScriptInteger Power(JavaScriptInteger n)
 {
     return new JavaScriptInteger(Convert.ToInt32(Math.Pow(value, n.value)));
 }