예제 #1
0
        public int IndexOf(JsValue valueToFind, int?startIndex = null)
        {
            var args = new List <JsValue>
            {
                valueToFind
            };

            if (startIndex.HasValue == true)
            {
                args.Add(ValueFactory.CreateNumber(startIndex.Value));
            }

            var fn     = GetProperty <JsFunction>("indexOf");
            var result = fn.Call <JsNumber>(this, args.ToArray());

            return(result.ToInt32());
        }
예제 #2
0
 public JsNumber CreateNumber(int number)
 {
     return(ValueFactory.CreateNumber(number));
 }