Commit 29b9237c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Removed no longer needed caller argument from jsdisp_get_idx.

parent 0d9cc454
...@@ -161,15 +161,14 @@ static HRESULT Array_length(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP ...@@ -161,15 +161,14 @@ static HRESULT Array_length(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
return S_OK; return S_OK;
} }
static HRESULT concat_array(jsdisp_t *array, ArrayInstance *obj, DWORD *len, static HRESULT concat_array(jsdisp_t *array, ArrayInstance *obj, DWORD *len, jsexcept_t *ei)
jsexcept_t *ei, IServiceProvider *caller)
{ {
VARIANT var; VARIANT var;
DWORD i; DWORD i;
HRESULT hres; HRESULT hres;
for(i=0; i < obj->length; i++) { for(i=0; i < obj->length; i++) {
hres = jsdisp_get_idx(&obj->dispex, i, &var, ei, caller); hres = jsdisp_get_idx(&obj->dispex, i, &var, ei);
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
continue; continue;
if(FAILED(hres)) if(FAILED(hres))
...@@ -185,7 +184,7 @@ static HRESULT concat_array(jsdisp_t *array, ArrayInstance *obj, DWORD *len, ...@@ -185,7 +184,7 @@ static HRESULT concat_array(jsdisp_t *array, ArrayInstance *obj, DWORD *len,
return S_OK; return S_OK;
} }
static HRESULT concat_obj(jsdisp_t *array, IDispatch *obj, DWORD *len, jsexcept_t *ei, IServiceProvider *caller) static HRESULT concat_obj(jsdisp_t *array, IDispatch *obj, DWORD *len, jsexcept_t *ei)
{ {
jsdisp_t *jsobj; jsdisp_t *jsobj;
VARIANT var; VARIANT var;
...@@ -194,7 +193,7 @@ static HRESULT concat_obj(jsdisp_t *array, IDispatch *obj, DWORD *len, jsexcept_ ...@@ -194,7 +193,7 @@ static HRESULT concat_obj(jsdisp_t *array, IDispatch *obj, DWORD *len, jsexcept_
jsobj = iface_to_jsdisp((IUnknown*)obj); jsobj = iface_to_jsdisp((IUnknown*)obj);
if(jsobj) { if(jsobj) {
if(is_class(jsobj, JSCLASS_ARRAY)) { if(is_class(jsobj, JSCLASS_ARRAY)) {
hres = concat_array(array, (ArrayInstance*)jsobj, len, ei, caller); hres = concat_array(array, (ArrayInstance*)jsobj, len, ei);
jsdisp_release(jsobj); jsdisp_release(jsobj);
return hres; return hres;
} }
...@@ -219,7 +218,7 @@ static HRESULT Array_concat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP ...@@ -219,7 +218,7 @@ static HRESULT Array_concat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = concat_obj(ret, jsthis->u.disp, &len, ei, caller); hres = concat_obj(ret, jsthis->u.disp, &len, ei);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
VARIANT *arg; VARIANT *arg;
DWORD i; DWORD i;
...@@ -227,7 +226,7 @@ static HRESULT Array_concat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP ...@@ -227,7 +226,7 @@ static HRESULT Array_concat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DISP
for(i=0; i < arg_cnt(dp); i++) { for(i=0; i < arg_cnt(dp); i++) {
arg = get_arg(dp, i); arg = get_arg(dp, i);
if(V_VT(arg) == VT_DISPATCH) if(V_VT(arg) == VT_DISPATCH)
hres = concat_obj(ret, V_DISPATCH(arg), &len, ei, caller); hres = concat_obj(ret, V_DISPATCH(arg), &len, ei);
else else
hres = jsdisp_propput_idx(ret, len++, arg, ei); hres = jsdisp_propput_idx(ret, len++, arg, ei);
if(FAILED(hres)) if(FAILED(hres))
...@@ -268,7 +267,7 @@ static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, cons ...@@ -268,7 +267,7 @@ static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, cons
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
for(i=0; i < length; i++) { for(i=0; i < length; i++) {
hres = jsdisp_get_idx(array, i, &var, ei, caller); hres = jsdisp_get_idx(array, i, &var, ei);
if(hres == DISP_E_UNKNOWNNAME) { if(hres == DISP_E_UNKNOWNNAME) {
hres = S_OK; hres = S_OK;
continue; continue;
...@@ -401,7 +400,7 @@ static HRESULT Array_pop(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARA ...@@ -401,7 +400,7 @@ static HRESULT Array_pop(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPARA
} }
length--; length--;
hres = jsdisp_get_idx(jsthis, length, &val, ei, caller); hres = jsdisp_get_idx(jsthis, length, &val, ei);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = jsdisp_delete_idx(jsthis, length); hres = jsdisp_delete_idx(jsthis, length);
} else if(hres == DISP_E_UNKNOWNNAME) { } else if(hres == DISP_E_UNKNOWNNAME) {
...@@ -476,11 +475,11 @@ static HRESULT Array_reverse(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISP ...@@ -476,11 +475,11 @@ static HRESULT Array_reverse(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISP
for(k=0; k<length/2; k++) { for(k=0; k<length/2; k++) {
l = length-k-1; l = length-k-1;
hres1 = jsdisp_get_idx(jsthis, k, &v1, ei, sp); hres1 = jsdisp_get_idx(jsthis, k, &v1, ei);
if(FAILED(hres1) && hres1!=DISP_E_UNKNOWNNAME) if(FAILED(hres1) && hres1!=DISP_E_UNKNOWNNAME)
return hres1; return hres1;
hres2 = jsdisp_get_idx(jsthis, l, &v2, ei, sp); hres2 = jsdisp_get_idx(jsthis, l, &v2, ei);
if(FAILED(hres2) && hres2!=DISP_E_UNKNOWNNAME) { if(FAILED(hres2) && hres2!=DISP_E_UNKNOWNNAME) {
VariantClear(&v1); VariantClear(&v1);
return hres2; return hres2;
...@@ -543,14 +542,14 @@ static HRESULT Array_shift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPA ...@@ -543,14 +542,14 @@ static HRESULT Array_shift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPA
return S_OK; return S_OK;
} }
hres = jsdisp_get_idx(jsthis, 0, &ret, ei, caller); hres = jsdisp_get_idx(jsthis, 0, &ret, ei);
if(hres == DISP_E_UNKNOWNNAME) { if(hres == DISP_E_UNKNOWNNAME) {
V_VT(&ret) = VT_EMPTY; V_VT(&ret) = VT_EMPTY;
hres = S_OK; hres = S_OK;
} }
for(i=1; SUCCEEDED(hres) && i<length; i++) { for(i=1; SUCCEEDED(hres) && i<length; i++) {
hres = jsdisp_get_idx(jsthis, i, &v, ei, caller); hres = jsdisp_get_idx(jsthis, i, &v, ei);
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = jsdisp_delete_idx(jsthis, i-1); hres = jsdisp_delete_idx(jsthis, i-1);
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
...@@ -625,7 +624,7 @@ static HRESULT Array_slice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPA ...@@ -625,7 +624,7 @@ static HRESULT Array_slice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPA
return hres; return hres;
for(idx=start; idx<end; idx++) { for(idx=start; idx<end; idx++) {
hres = jsdisp_get_idx(jsthis, idx, &v, ei, sp); hres = jsdisp_get_idx(jsthis, idx, &v, ei);
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
continue; continue;
...@@ -756,7 +755,7 @@ static HRESULT Array_sort(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPAR ...@@ -756,7 +755,7 @@ static HRESULT Array_sort(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPPAR
vtab = heap_alloc_zero(length * sizeof(VARIANT)); vtab = heap_alloc_zero(length * sizeof(VARIANT));
if(vtab) { if(vtab) {
for(i=0; i<length; i++) { for(i=0; i<length; i++) {
hres = jsdisp_get_idx(jsthis, i, vtab+i, ei, caller); hres = jsdisp_get_idx(jsthis, i, vtab+i, ei);
if(hres == DISP_E_UNKNOWNNAME) { if(hres == DISP_E_UNKNOWNNAME) {
V_VT(vtab+i) = VT_EMPTY; V_VT(vtab+i) = VT_EMPTY;
hres = S_OK; hres = S_OK;
...@@ -911,7 +910,7 @@ static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPP ...@@ -911,7 +910,7 @@ static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPP
return hres; return hres;
for(i=0; SUCCEEDED(hres) && i < delete_cnt; i++) { for(i=0; SUCCEEDED(hres) && i < delete_cnt; i++) {
hres = jsdisp_get_idx(jsthis, start+i, &v, ei, caller); hres = jsdisp_get_idx(jsthis, start+i, &v, ei);
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = S_OK; hres = S_OK;
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
...@@ -928,7 +927,7 @@ static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPP ...@@ -928,7 +927,7 @@ static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPP
if(add_args < delete_cnt) { if(add_args < delete_cnt) {
for(i = start; SUCCEEDED(hres) && i < length-delete_cnt; i++) { for(i = start; SUCCEEDED(hres) && i < length-delete_cnt; i++) {
hres = jsdisp_get_idx(jsthis, i+delete_cnt, &v, ei, caller); hres = jsdisp_get_idx(jsthis, i+delete_cnt, &v, ei);
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = jsdisp_delete_idx(jsthis, i+add_args); hres = jsdisp_delete_idx(jsthis, i+add_args);
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
...@@ -939,7 +938,7 @@ static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPP ...@@ -939,7 +938,7 @@ static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, DISPP
hres = jsdisp_delete_idx(jsthis, i-1); hres = jsdisp_delete_idx(jsthis, i-1);
}else if(add_args > delete_cnt) { }else if(add_args > delete_cnt) {
for(i=length-delete_cnt; SUCCEEDED(hres) && i != start; i--) { for(i=length-delete_cnt; SUCCEEDED(hres) && i != start; i--) {
hres = jsdisp_get_idx(jsthis, i+delete_cnt-1, &v, ei, caller); hres = jsdisp_get_idx(jsthis, i+delete_cnt-1, &v, ei);
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = jsdisp_delete_idx(jsthis, i+add_args-1); hres = jsdisp_delete_idx(jsthis, i+add_args-1);
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
......
...@@ -1148,7 +1148,7 @@ HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, VARIANT *var, jsex ...@@ -1148,7 +1148,7 @@ HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, VARIANT *var, jsex
return prop_get(obj, prop, &dp, var, ei, NULL); return prop_get(obj, prop, &dp, var, ei, NULL);
} }
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, VARIANT *var, jsexcept_t *ei, IServiceProvider *caller) HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, VARIANT *var, jsexcept_t *ei)
{ {
WCHAR name[12]; WCHAR name[12];
DISPPARAMS dp = {NULL, NULL, 0, 0}; DISPPARAMS dp = {NULL, NULL, 0, 0};
...@@ -1167,7 +1167,7 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, VARIANT *var, jsexcept_t *ei, I ...@@ -1167,7 +1167,7 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, VARIANT *var, jsexcept_t *ei, I
if(!prop || prop->type==PROP_DELETED) if(!prop || prop->type==PROP_DELETED)
return DISP_E_UNKNOWNNAME; return DISP_E_UNKNOWNNAME;
return prop_get(obj, prop, &dp, var, ei, caller); return prop_get(obj, prop, &dp, var, ei, NULL);
} }
HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, VARIANT *val, jsexcept_t *ei) HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, VARIANT *val, jsexcept_t *ei)
......
...@@ -357,8 +357,7 @@ static HRESULT Function_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, ...@@ -357,8 +357,7 @@ static HRESULT Function_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags,
return S_OK; return S_OK;
} }
static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, jsexcept_t *ei, IServiceProvider *caller, static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, jsexcept_t *ei, DISPPARAMS *args)
DISPPARAMS *args)
{ {
VARIANT var, *argv; VARIANT var, *argv;
DWORD length, i; DWORD length, i;
...@@ -378,7 +377,7 @@ static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, jsexcept_t ...@@ -378,7 +377,7 @@ static HRESULT array_to_args(script_ctx_t *ctx, jsdisp_t *arg_array, jsexcept_t
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
for(i=0; i<length; i++) { for(i=0; i<length; i++) {
hres = jsdisp_get_idx(arg_array, i, argv+i, ei, caller); hres = jsdisp_get_idx(arg_array, i, argv+i, ei);
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
V_VT(argv+i) = VT_EMPTY; V_VT(argv+i) = VT_EMPTY;
else if(FAILED(hres)) { else if(FAILED(hres)) {
...@@ -432,7 +431,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI ...@@ -432,7 +431,7 @@ static HRESULT Function_apply(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, DI
} }
if(arg_array) { if(arg_array) {
hres = array_to_args(ctx, arg_array, ei, caller, &args); hres = array_to_args(ctx, arg_array, ei, &args);
jsdisp_release(arg_array); jsdisp_release(arg_array);
}else { }else {
FIXME("throw TypeError\n"); FIXME("throw TypeError\n");
......
...@@ -217,7 +217,7 @@ HRESULT jsdisp_propput_name(jsdisp_t*,const WCHAR*,VARIANT*,jsexcept_t*) DECLSPE ...@@ -217,7 +217,7 @@ HRESULT jsdisp_propput_name(jsdisp_t*,const WCHAR*,VARIANT*,jsexcept_t*) DECLSPE
HRESULT jsdisp_propput_const(jsdisp_t*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN; HRESULT jsdisp_propput_const(jsdisp_t*,const WCHAR*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_idx(jsdisp_t*,DWORD,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_propput_idx(jsdisp_t*,DWORD,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_get_idx(jsdisp_t*,DWORD,VARIANT*,jsexcept_t*,IServiceProvider*) DECLSPEC_HIDDEN; HRESULT jsdisp_get_idx(jsdisp_t*,DWORD,VARIANT*,jsexcept_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_get_id(jsdisp_t*,const WCHAR*,DWORD,DISPID*) DECLSPEC_HIDDEN; HRESULT jsdisp_get_id(jsdisp_t*,const WCHAR*,DWORD,DISPID*) DECLSPEC_HIDDEN;
HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD) DECLSPEC_HIDDEN; HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD) DECLSPEC_HIDDEN;
VARIANT_BOOL jsdisp_is_own_prop(jsdisp_t *obj, BSTR name) DECLSPEC_HIDDEN; VARIANT_BOOL jsdisp_is_own_prop(jsdisp_t *obj, BSTR name) DECLSPEC_HIDDEN;
......
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