Commit f8383c34 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Don't use DISPPARAMS for internal arguments.

parent 0307d735
......@@ -138,7 +138,7 @@ static IUnknown *create_activex_object(script_ctx_t *ctx, const WCHAR *progid)
return obj;
}
static HRESULT ActiveXObject_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT ActiveXObject_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
IDispatch *disp;
......@@ -159,12 +159,12 @@ static HRESULT ActiveXObject_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag
return E_NOTIMPL;
}
if(arg_cnt(dp) != 1) {
FIXME("unsupported arg_cnt %d\n", arg_cnt(dp));
if(argc != 1) {
FIXME("unsupported argc %d\n", argc);
return E_NOTIMPL;
}
hres = to_string(ctx, get_arg(dp,0), ei, &progid);
hres = to_string(ctx, argv, ei, &progid);
if(FAILED(hres))
return hres;
......
......@@ -38,7 +38,7 @@ static inline BoolInstance *bool_this(vdisp_t *jsthis)
}
/* ECMA-262 3rd Edition 15.6.4.2 */
static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
BoolInstance *bool;
......@@ -68,7 +68,7 @@ static HRESULT Bool_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
}
/* ECMA-262 3rd Edition 15.6.4.3 */
static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
BoolInstance *bool;
......@@ -86,7 +86,7 @@ static HRESULT Bool_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
return S_OK;
}
static HRESULT Bool_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Bool_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -117,14 +117,14 @@ static const builtin_info_t Bool_info = {
NULL
};
static HRESULT BoolConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT BoolConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
HRESULT hres;
VARIANT_BOOL value = VARIANT_FALSE;
if(arg_cnt(dp)) {
hres = to_boolean(get_arg(dp,0), &value);
if(argc) {
hres = to_boolean(argv, &value);
if(FAILED(hres))
return hres;
}
......
......@@ -133,6 +133,14 @@ static inline VARIANT *stack_topn(exec_ctx_t *ctx, unsigned n)
return ctx->stack + ctx->top-1-n;
}
static inline VARIANT *stack_args(exec_ctx_t *ctx, unsigned n)
{
if(!n)
return NULL;
assert(ctx->top > n-1);
return ctx->stack + ctx->top-n;
}
static inline VARIANT *stack_pop(exec_ctx_t *ctx)
{
assert(ctx->top);
......@@ -972,32 +980,11 @@ static HRESULT interp_refval(exec_ctx_t *ctx)
return stack_push(ctx, &v);
}
static void jsstack_to_dp(exec_ctx_t *ctx, unsigned arg_cnt, DISPPARAMS *dp)
{
VARIANT tmp;
unsigned i;
dp->cArgs = arg_cnt;
dp->rgdispidNamedArgs = NULL;
dp->cNamedArgs = 0;
assert(ctx->top >= arg_cnt);
for(i=1; i*2 <= arg_cnt; i++) {
tmp = ctx->stack[ctx->top-i];
ctx->stack[ctx->top-i] = ctx->stack[ctx->top-arg_cnt+i-1];
ctx->stack[ctx->top-arg_cnt+i-1] = tmp;
}
dp->rgvarg = ctx->stack + ctx->top-arg_cnt;
}
/* ECMA-262 3rd Edition 11.2.2 */
static HRESULT interp_new(exec_ctx_t *ctx)
{
const unsigned arg = get_op_uint(ctx, 0);
VARIANT *constr, v;
DISPPARAMS dp;
HRESULT hres;
TRACE("%d\n", arg);
......@@ -1013,8 +1000,7 @@ static HRESULT interp_new(exec_ctx_t *ctx)
else if(!V_DISPATCH(constr))
return throw_type_error(ctx->script, ctx->ei, JS_E_INVALID_PROPERTY, NULL);
jsstack_to_dp(ctx, arg, &dp);
hres = disp_call_value(ctx->script, V_DISPATCH(constr), NULL, DISPATCH_CONSTRUCT, &dp, &v, ctx->ei);
hres = disp_call_value(ctx->script, V_DISPATCH(constr), NULL, DISPATCH_CONSTRUCT, arg, stack_args(ctx, arg), &v, ctx->ei);
if(FAILED(hres))
return hres;
......@@ -1028,7 +1014,6 @@ static HRESULT interp_call(exec_ctx_t *ctx)
const unsigned argn = get_op_uint(ctx, 0);
const int do_ret = get_op_int(ctx, 1);
VARIANT v, *objv;
DISPPARAMS dp;
HRESULT hres;
TRACE("%d %d\n", argn, do_ret);
......@@ -1037,8 +1022,7 @@ static HRESULT interp_call(exec_ctx_t *ctx)
if(V_VT(objv) != VT_DISPATCH)
return throw_type_error(ctx->script, ctx->ei, JS_E_INVALID_PROPERTY, NULL);
jsstack_to_dp(ctx, argn, &dp);
hres = disp_call_value(ctx->script, V_DISPATCH(objv), NULL, DISPATCH_METHOD, &dp,
hres = disp_call_value(ctx->script, V_DISPATCH(objv), NULL, DISPATCH_METHOD, argn, stack_args(ctx, argn),
do_ret ? &v : NULL, ctx->ei);
if(FAILED(hres))
return hres;
......@@ -1054,7 +1038,6 @@ static HRESULT interp_call_member(exec_ctx_t *ctx)
const unsigned argn = get_op_uint(ctx, 0);
const int do_ret = get_op_int(ctx, 1);
IDispatch *obj;
DISPPARAMS dp;
VARIANT v;
DISPID id;
HRESULT hres;
......@@ -1065,8 +1048,7 @@ static HRESULT interp_call_member(exec_ctx_t *ctx)
if(!obj)
return throw_type_error(ctx->script, ctx->ei, id, NULL);
jsstack_to_dp(ctx, argn, &dp);
hres = disp_call(ctx->script, obj, id, DISPATCH_METHOD, &dp, do_ret ? &v : NULL, ctx->ei);
hres = disp_call(ctx->script, obj, id, DISPATCH_METHOD, argn, stack_args(ctx, argn), do_ret ? &v : NULL, ctx->ei);
if(FAILED(hres))
return hres;
......@@ -2398,9 +2380,7 @@ static HRESULT interp_assign(exec_ctx_t *ctx)
static HRESULT interp_assign_call(exec_ctx_t *ctx)
{
const unsigned arg = get_op_uint(ctx, 0);
DISPID propput_dispid = DISPID_PROPERTYPUT;
IDispatch *disp;
DISPPARAMS dp;
VARIANT *v;
DISPID id;
HRESULT hres;
......@@ -2411,10 +2391,7 @@ static HRESULT interp_assign_call(exec_ctx_t *ctx)
if(!disp)
return throw_reference_error(ctx->script, ctx->ei, JS_E_ILLEGAL_ASSIGN, NULL);
jsstack_to_dp(ctx, arg+1, &dp);
dp.cNamedArgs = 1;
dp.rgdispidNamedArgs = &propput_dispid;
hres = disp_call(ctx->script, disp, id, DISPATCH_PROPERTYPUT, &dp, NULL, ctx->ei);
hres = disp_call(ctx->script, disp, id, DISPATCH_PROPERTYPUT, arg+1, stack_args(ctx,arg+1), NULL, ctx->ei);
if(FAILED(hres))
return hres;
......
......@@ -35,7 +35,7 @@ static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0};
/* ECMA-262 3rd Edition 15.11.4.4 */
static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
jsdisp_t *jsthis;
BSTR name = NULL, msg = NULL, ret = NULL;
......@@ -127,7 +127,7 @@ static HRESULT Error_toString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
}
static HRESULT Error_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -226,28 +226,28 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr,
return S_OK;
}
static HRESULT error_constr(script_ctx_t *ctx, WORD flags, DISPPARAMS *dp,
static HRESULT error_constr(script_ctx_t *ctx, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei, jsdisp_t *constr) {
jsdisp_t *err;
UINT num = 0;
BSTR msg = NULL;
HRESULT hres;
if(arg_cnt(dp)) {
if(argc) {
double n;
hres = to_number(ctx, get_arg(dp, 0), ei, &n);
hres = to_number(ctx, argv, ei, &n);
if(FAILED(hres)) /* FIXME: really? */
n = NAN;
if(isnan(n))
hres = to_string(ctx, get_arg(dp, 0), ei, &msg);
hres = to_string(ctx, argv, ei, &msg);
if(FAILED(hres))
return hres;
num = n;
}
if(arg_cnt(dp)>1 && !msg) {
hres = to_string(ctx, get_arg(dp, 1), ei, &msg);
if(argc>1 && !msg) {
hres = to_string(ctx, argv+1, ei, &msg);
if(FAILED(hres))
return hres;
}
......@@ -275,59 +275,59 @@ static HRESULT error_constr(script_ctx_t *ctx, WORD flags, DISPPARAMS *dp,
}
static HRESULT ErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->error_constr);
}
static HRESULT EvalErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->eval_error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->eval_error_constr);
}
static HRESULT RangeErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->range_error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->range_error_constr);
}
static HRESULT ReferenceErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->reference_error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->reference_error_constr);
}
static HRESULT RegExpErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->regexp_error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->regexp_error_constr);
}
static HRESULT SyntaxErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->syntax_error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->syntax_error_constr);
}
static HRESULT TypeErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->type_error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->type_error_constr);
}
static HRESULT URIErrorConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
return error_constr(ctx, flags, dp, retv, ei, ctx->uri_error_constr);
return error_constr(ctx, flags, argc, argv, retv, ei, ctx->uri_error_constr);
}
HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
......
......@@ -152,7 +152,7 @@ static inline jsdisp_t *get_jsdisp(vdisp_t *vdisp)
return is_jsdisp(vdisp) ? vdisp->u.jsdisp : NULL;
}
typedef HRESULT (*builtin_invoke_t)(script_ctx_t*,vdisp_t*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*);
typedef HRESULT (*builtin_invoke_t)(script_ctx_t*,vdisp_t*,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*);
typedef struct {
const WCHAR *name;
......@@ -206,11 +206,11 @@ HRESULT create_dispex(script_ctx_t*,const builtin_info_t*,jsdisp_t*,jsdisp_t**)
HRESULT init_dispex(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*) DECLSPEC_HIDDEN;
HRESULT init_dispex_from_constr(jsdisp_t*,script_ctx_t*,const builtin_info_t*,jsdisp_t*) DECLSPEC_HIDDEN;
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_call_value(script_ctx_t*,IDispatch*,IDispatch*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_value(jsdisp_t*,IDispatch*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call(jsdisp_t*,DISPID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_name(jsdisp_t*,const WCHAR*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_call_value(script_ctx_t*,IDispatch*,IDispatch*,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_value(jsdisp_t*,IDispatch*,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call(jsdisp_t*,DISPID,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_call_name(jsdisp_t*,const WCHAR*,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_propget(script_ctx_t*,IDispatch*,DISPID,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget(jsdisp_t*,DISPID,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
......@@ -225,8 +225,8 @@ VARIANT_BOOL jsdisp_is_own_prop(jsdisp_t *obj, BSTR name) DECLSPEC_HIDDEN;
HRESULT create_builtin_function(script_ctx_t*,builtin_invoke_t,const WCHAR*,const builtin_info_t*,DWORD,
jsdisp_t*,jsdisp_t**) DECLSPEC_HIDDEN;
HRESULT Function_value(script_ctx_t*,vdisp_t*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT Function_invoke(jsdisp_t*,IDispatch*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*);
HRESULT Function_value(script_ctx_t*,vdisp_t*,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT Function_invoke(jsdisp_t*,IDispatch*,WORD,unsigned,VARIANT*,VARIANT*,jsexcept_t*);
HRESULT throw_eval_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
HRESULT throw_generic_error(script_ctx_t*,jsexcept_t*,HRESULT,const WCHAR*) DECLSPEC_HIDDEN;
......
......@@ -203,7 +203,6 @@ HRESULT to_primitive(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret
case VT_DISPATCH: {
jsdisp_t *jsdisp;
DISPID id;
DISPPARAMS dp = {NULL, NULL, 0, 0};
HRESULT hres;
static const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0};
......@@ -227,7 +226,7 @@ HRESULT to_primitive(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret
hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? toStringW : valueOfW, 0, &id);
if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, &dp, ret, ei);
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, ret, ei);
if(FAILED(hres)) {
WARN("call error - forwarding exception\n");
jsdisp_release(jsdisp);
......@@ -243,7 +242,7 @@ HRESULT to_primitive(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret
hres = jsdisp_get_id(jsdisp, hint == HINT_STRING ? valueOfW : toStringW, 0, &id);
if(SUCCEEDED(hres)) {
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, &dp, ret, ei);
hres = jsdisp_call(jsdisp, id, DISPATCH_METHOD, 0, NULL, ret, ei);
if(FAILED(hres)) {
WARN("call error - forwarding exception\n");
jsdisp_release(jsdisp);
......
......@@ -218,7 +218,7 @@ static inline void number_to_exponential(double val, int prec, BSTR *out)
}
/* ECMA-262 3rd Edition 15.7.4.2 */
static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
NumberInstance *number;
......@@ -232,8 +232,8 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
if(arg_cnt(dp)) {
hres = to_int32(ctx, get_arg(dp, 0), ei, &radix);
if(argc) {
hres = to_int32(ctx, argv, ei, &radix);
if(FAILED(hres))
return hres;
......@@ -343,14 +343,14 @@ static HRESULT Number_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
return S_OK;
}
static HRESULT Number_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Number_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
NumberInstance *number;
......@@ -364,8 +364,8 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
if(arg_cnt(dp)) {
hres = to_int32(ctx, get_arg(dp, 0), ei, &prec);
if(argc) {
hres = to_int32(ctx, argv, ei, &prec);
if(FAILED(hres))
return hres;
......@@ -394,7 +394,7 @@ static HRESULT Number_toFixed(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
return S_OK;
}
static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
NumberInstance *number;
......@@ -408,8 +408,8 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
if(arg_cnt(dp)) {
hres = to_int32(ctx, get_arg(dp, 0), ei, &prec);
if(argc) {
hres = to_int32(ctx, argv, ei, &prec);
if(FAILED(hres))
return hres;
......@@ -440,7 +440,7 @@ static HRESULT Number_toExponential(script_ctx_t *ctx, vdisp_t *jsthis, WORD fla
return S_OK;
}
static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
NumberInstance *number;
......@@ -452,8 +452,8 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
if(!(number = number_this(jsthis)))
return throw_type_error(ctx, ei, JS_E_NUMBER_EXPECTED, NULL);
if(arg_cnt(dp)) {
hres = to_int32(ctx, get_arg(dp, 0), ei, &prec);
if(argc) {
hres = to_int32(ctx, argv, ei, &prec);
if(FAILED(hres))
return hres;
......@@ -490,7 +490,7 @@ static HRESULT Number_toPrecision(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
return S_OK;
}
static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
NumberInstance *number;
......@@ -505,7 +505,7 @@ static HRESULT Number_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
return S_OK;
}
static HRESULT Number_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Number_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
NumberInstance *number = number_from_vdisp(jsthis);
......@@ -543,7 +543,7 @@ static const builtin_info_t Number_info = {
NULL
};
static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
double n;
......@@ -553,13 +553,13 @@ static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
switch(flags) {
case INVOKE_FUNC:
if(!arg_cnt(dp)) {
if(!argc) {
if(retv)
num_set_int(retv, 0);
return S_OK;
}
hres = to_number(ctx, get_arg(dp, 0), ei, &n);
hres = to_number(ctx, argv, ei, &n);
if(FAILED(hres))
return hres;
......@@ -570,8 +570,8 @@ static HRESULT NumberConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
case DISPATCH_CONSTRUCT: {
jsdisp_t *obj;
if(arg_cnt(dp)) {
hres = to_number(ctx, get_arg(dp, 0), ei, &n);
if(argc) {
hres = to_number(ctx, argv, ei, &n);
if(FAILED(hres))
return hres;
}else {
......
......@@ -32,7 +32,7 @@ static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','
static const WCHAR default_valueW[] = {'[','o','b','j','e','c','t',' ','O','b','j','e','c','t',']',0};
static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
jsdisp_t *jsdisp;
......@@ -78,11 +78,9 @@ static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D
return S_OK;
}
static HRESULT Object_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Object_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
DISPPARAMS params = {NULL, NULL, 0, 0};
TRACE("\n");
if(!is_jsdisp(jsthis)) {
......@@ -90,10 +88,10 @@ static HRESULT Object_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
return E_FAIL;
}
return jsdisp_call_name(jsthis->u.jsdisp, toStringW, DISPATCH_METHOD, &params, retv, ei);
return jsdisp_call_name(jsthis->u.jsdisp, toStringW, DISPATCH_METHOD, 0, NULL, retv, ei);
}
static HRESULT Object_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Object_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -108,7 +106,7 @@ static HRESULT Object_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
return S_OK;
}
static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
BSTR name;
......@@ -118,7 +116,7 @@ static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
TRACE("\n");
if(!arg_cnt(dp)) {
if(!argc) {
if(retv) {
V_VT(retv) = VT_BOOL;
V_BOOL(retv) = VARIANT_FALSE;
......@@ -127,7 +125,7 @@ static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
return S_OK;
}
hres = to_string(ctx, get_arg(dp, 0), ei, &name);
hres = to_string(ctx, argv, ei, &name);
if(FAILED(hres))
return hres;
......@@ -154,21 +152,21 @@ static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl
return S_OK;
}
static HRESULT Object_propertyIsEnumerable(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Object_propertyIsEnumerable(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Object_isPrototypeOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Object_isPrototypeOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT Object_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT Object_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -213,7 +211,7 @@ static const builtin_info_t Object_info = {
NULL
};
static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
HRESULT hres;
......@@ -222,13 +220,11 @@ static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
switch(flags) {
case DISPATCH_METHOD:
if(arg_cnt(dp)) {
VARIANT *arg = get_arg(dp,0);
if(V_VT(arg) != VT_EMPTY && V_VT(arg) != VT_NULL && (V_VT(arg) != VT_DISPATCH || V_DISPATCH(arg))) {
if(argc) {
if(V_VT(argv) != VT_EMPTY && V_VT(argv) != VT_NULL && (V_VT(argv) != VT_DISPATCH || V_DISPATCH(argv))) {
IDispatch *disp;
hres = to_object(ctx, arg, &disp);
hres = to_object(ctx, argv, &disp);
if(FAILED(hres))
return hres;
......
......@@ -3473,7 +3473,7 @@ HRESULT regexp_match(script_ctx_t *ctx, jsdisp_t *dispex, const WCHAR *str, DWOR
return S_OK;
}
static HRESULT RegExp_source(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_source(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -3496,21 +3496,21 @@ static HRESULT RegExp_source(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DIS
return S_OK;
}
static HRESULT RegExp_global(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_global(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT RegExp_ignoreCase(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_ignoreCase(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
return E_NOTIMPL;
}
static HRESULT RegExp_multiline(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_multiline(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
......@@ -3534,7 +3534,7 @@ static INT index_from_var(script_ctx_t *ctx, VARIANT *v)
return is_int32(n) ? n : 0;
}
static HRESULT RegExp_lastIndex(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_lastIndex(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -3548,15 +3548,13 @@ static HRESULT RegExp_lastIndex(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
}
case DISPATCH_PROPERTYPUT: {
RegExpInstance *regexp = regexp_from_vdisp(jsthis);
VARIANT *arg;
HRESULT hres;
arg = get_arg(dp,0);
hres = VariantCopy(&regexp->last_index_var, arg);
hres = VariantCopy(&regexp->last_index_var, argv);
if(FAILED(hres))
return hres;
regexp->last_index = index_from_var(ctx, arg);
regexp->last_index = index_from_var(ctx, argv);
break;
}
default:
......@@ -3567,7 +3565,7 @@ static HRESULT RegExp_lastIndex(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
return S_OK;
}
static HRESULT RegExp_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
......@@ -3698,7 +3696,7 @@ static HRESULT run_exec(script_ctx_t *ctx, vdisp_t *jsthis, VARIANT *arg, jsexce
return S_OK;
}
static HRESULT RegExp_exec(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_exec(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
match_result_t *parens = NULL, match;
......@@ -3709,7 +3707,7 @@ static HRESULT RegExp_exec(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPP
TRACE("\n");
hres = run_exec(ctx, jsthis, arg_cnt(dp) ? get_arg(dp,0) : NULL, ei, &string, &match, &parens, &parens_cnt, &b);
hres = run_exec(ctx, jsthis, argc ? argv : NULL, ei, &string, &match, &parens, &parens_cnt, &b);
if(FAILED(hres))
return hres;
......@@ -3732,18 +3730,16 @@ static HRESULT RegExp_exec(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPP
return hres;
}
static HRESULT RegExp_test(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_test(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
match_result_t match;
VARIANT undef_var;
VARIANT_BOOL b;
DWORD argc;
HRESULT hres;
TRACE("\n");
argc = arg_cnt(dp);
if(!argc) {
V_VT(&undef_var) = VT_BSTR;
V_BSTR(&undef_var) = SysAllocString(undefinedW);
......@@ -3751,7 +3747,7 @@ static HRESULT RegExp_test(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPP
return E_OUTOFMEMORY;
}
hres = run_exec(ctx, jsthis, argc ? get_arg(dp,0) : &undef_var, ei, NULL, &match, NULL, NULL, &b);
hres = run_exec(ctx, jsthis, argc ? argv : &undef_var, ei, NULL, &match, NULL, NULL, &b);
if(!argc)
SysFreeString(V_BSTR(&undef_var));
if(FAILED(hres))
......@@ -3764,7 +3760,7 @@ static HRESULT RegExp_test(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPP
return S_OK;
}
static HRESULT RegExp_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExp_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -4014,7 +4010,7 @@ HRESULT regexp_string_match(script_ctx_t *ctx, jsdisp_t *re, BSTR str,
}
static HRESULT RegExpConstr_leftContext(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -4041,7 +4037,7 @@ static HRESULT RegExpConstr_leftContext(script_ctx_t *ctx, vdisp_t *jsthis, WORD
}
static HRESULT RegExpConstr_rightContext(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei)
unsigned argc, VARIANT *argv, VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
......@@ -4067,20 +4063,19 @@ static HRESULT RegExpConstr_rightContext(script_ctx_t *ctx, vdisp_t *jsthis, WOR
return S_OK;
}
static HRESULT RegExpConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT RegExpConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
TRACE("\n");
switch(flags) {
case DISPATCH_METHOD:
if(arg_cnt(dp)) {
VARIANT *arg = get_arg(dp,0);
if(V_VT(arg) == VT_DISPATCH) {
jsdisp_t *jsdisp = iface_to_jsdisp((IUnknown*)V_DISPATCH(arg));
if(argc) {
if(V_VT(argv) == VT_DISPATCH) {
jsdisp_t *jsdisp = iface_to_jsdisp((IUnknown*)V_DISPATCH(argv));
if(jsdisp) {
if(is_class(jsdisp, JSCLASS_REGEXP)) {
if(arg_cnt(dp) > 1 && V_VT(get_arg(dp,1)) != VT_EMPTY) {
if(argc > 1 && V_VT(argv+1) != VT_EMPTY) {
jsdisp_release(jsdisp);
return throw_regexp_error(ctx, ei, JS_E_REGEXP_SYNTAX, NULL);
}
......@@ -4100,12 +4095,12 @@ static HRESULT RegExpConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags
jsdisp_t *ret;
HRESULT hres;
if(!arg_cnt(dp)) {
if(!argc) {
FIXME("no args\n");
return E_NOTIMPL;
}
hres = create_regexp_var(ctx, get_arg(dp,0), arg_cnt(dp) > 1 ? get_arg(dp,1) : NULL, &ret);
hres = create_regexp_var(ctx, argv, argc > 1 ? argv+1 : NULL, &ret);
if(FAILED(hres))
return hres;
......
......@@ -44,7 +44,7 @@ static inline VBArrayInstance *vbarray_this(vdisp_t *jsthis)
return is_vclass(jsthis, JSCLASS_VBARRAY) ? vbarray_from_vdisp(jsthis) : NULL;
}
static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
VBArrayInstance *vbarray;
......@@ -60,11 +60,11 @@ static HRESULT VBArray_dimensions(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
return S_OK;
}
static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
VBArrayInstance *vbarray;
int i, *indexes, size;
int i, *indexes;
VARIANT out;
HRESULT hres;
......@@ -74,16 +74,15 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DI
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
size = arg_cnt(dp);
if(size < SafeArrayGetDim(vbarray->safearray))
if(argc < SafeArrayGetDim(vbarray->safearray))
return throw_range_error(ctx, ei, JS_E_SUBSCRIPT_OUT_OF_RANGE, NULL);
indexes = heap_alloc(sizeof(int)*size);
indexes = heap_alloc(sizeof(int)*argc);
if(!indexes)
return E_OUTOFMEMORY;
for(i=0; i<size; i++) {
hres = to_int32(ctx, get_arg(dp, i), ei, indexes+i);
for(i=0; i<argc; i++) {
hres = to_int32(ctx, argv+i, ei, indexes+i);
if(FAILED(hres)) {
heap_free(indexes);
return hres;
......@@ -103,7 +102,7 @@ static HRESULT VBArray_getItem(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DI
return hres;
}
static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
VBArrayInstance *vbarray;
......@@ -116,8 +115,8 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DIS
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
if(arg_cnt(dp)) {
hres = to_int32(ctx, get_arg(dp, 0), ei, &dim);
if(argc) {
hres = to_int32(ctx, argv, ei, &dim);
if(FAILED(hres))
return hres;
} else
......@@ -134,7 +133,7 @@ static HRESULT VBArray_lbound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DIS
return S_OK;
}
static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
VBArrayInstance *vbarray;
......@@ -182,7 +181,7 @@ static HRESULT VBArray_toArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DI
return S_OK;
}
static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
VBArrayInstance *vbarray;
......@@ -195,8 +194,8 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DIS
if(!vbarray)
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
if(arg_cnt(dp)) {
hres = to_int32(ctx, get_arg(dp, 0), ei, &dim);
if(argc) {
hres = to_int32(ctx, argv, ei, &dim);
if(FAILED(hres))
return hres;
} else
......@@ -213,7 +212,7 @@ static HRESULT VBArray_ubound(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DIS
return S_OK;
}
static HRESULT VBArray_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISPPARAMS *dp,
static HRESULT VBArray_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
FIXME("\n");
......@@ -275,10 +274,9 @@ static HRESULT alloc_vbarray(script_ctx_t *ctx, jsdisp_t *object_prototype, VBAr
return S_OK;
}
static HRESULT VBArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARAMS *dp,
static HRESULT VBArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, VARIANT *argv,
VARIANT *retv, jsexcept_t *ei)
{
VARIANT *arg;
VBArrayInstance *vbarray;
HRESULT hres;
......@@ -286,21 +284,21 @@ static HRESULT VBArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags
switch(flags) {
case DISPATCH_METHOD:
if(arg_cnt(dp)<1 || V_VT((arg = get_arg(dp, 0)))!=(VT_ARRAY|VT_VARIANT))
if(argc<1 || V_VT(argv) != (VT_ARRAY|VT_VARIANT))
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
hres = VariantCopy(retv, arg);
hres = VariantCopy(retv, argv);
return hres;
case DISPATCH_CONSTRUCT:
if(arg_cnt(dp)<1 || V_VT((arg = get_arg(dp, 0)))!=(VT_ARRAY|VT_VARIANT))
if(argc<1 || V_VT(argv) != (VT_ARRAY|VT_VARIANT))
return throw_type_error(ctx, ei, JS_E_VBARRAY_EXPECTED, NULL);
hres = alloc_vbarray(ctx, NULL, &vbarray);
if(FAILED(hres))
return hres;
hres = SafeArrayCopy(V_ARRAY(arg), &vbarray->safearray);
hres = SafeArrayCopy(V_ARRAY(argv), &vbarray->safearray);
if(FAILED(hres)) {
jsdisp_release(&vbarray->dispex);
return hres;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment