예제 #1
0
        /// <summary>
        ///     Invokes a function as a constructor.
        /// </summary>
        /// <remarks>
        ///     Requires an active script context.
        /// </remarks>
        /// <param name="arguments">The arguments to the call.</param>
        /// <returns>The <c>Value</c> returned from the function invocation.</returns>
        public JavaScriptValue ConstructObject(params JavaScriptValue[] arguments)
        {
            if (arguments.Length > UInt16.MaxValue)
            {
                throw new ArgumentOutOfRangeException("arguments");
            }

            Native.ThrowIfError(Native.JsConstructObject(this, arguments, (UInt16)arguments.Length, out JavaScriptValue returnReference));
            return(returnReference);
        }