Exemplo n.º 1
0
        public JsPromiseConstructor Race(params JsValue[] values)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }

            var arr = ValueFactory.CreateArray(0);

            foreach (var val in values)
            {
                arr.Push(val);
            }
            var fnRace = GetProperty <JsFunction>("race");
            var result = fnRace.Call <JsPromiseConstructor>(this, arr);

            Context.CurrentScope.ResolvePendingPromises();
            return(result);
        }
Exemplo n.º 2
0
 public JsArray CreateArray(uint length)
 {
     return(ValueFactory.CreateArray(length));
 }