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

jscript: Use script LCID in *disp_propput* functions.

parent 8b338786
...@@ -60,13 +60,13 @@ static HRESULT get_jsdisp_length(DispatchEx *obj, LCID lcid, jsexcept_t *ei, DWO ...@@ -60,13 +60,13 @@ static HRESULT get_jsdisp_length(DispatchEx *obj, LCID lcid, jsexcept_t *ei, DWO
return hres; return hres;
} }
static HRESULT set_jsdisp_length(DispatchEx *obj, LCID lcid, jsexcept_t *ei, DWORD length) static HRESULT set_jsdisp_length(DispatchEx *obj, jsexcept_t *ei, DWORD length)
{ {
VARIANT var; VARIANT var;
V_VT(&var) = VT_I4; V_VT(&var) = VT_I4;
V_I4(&var) = length; V_I4(&var) = length;
return jsdisp_propput_name(obj, lengthW, lcid, &var, ei, NULL/*FIXME*/); return jsdisp_propput_name(obj, lengthW, &var, ei, NULL/*FIXME*/);
} }
static WCHAR *idx_to_str(DWORD idx, WCHAR *ptr) static WCHAR *idx_to_str(DWORD idx, WCHAR *ptr)
...@@ -142,7 +142,7 @@ static HRESULT concat_array(DispatchEx *array, ArrayInstance *obj, DWORD *len, L ...@@ -142,7 +142,7 @@ static HRESULT concat_array(DispatchEx *array, ArrayInstance *obj, DWORD *len, L
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = jsdisp_propput_idx(array, *len+i, lcid, &var, ei, caller); hres = jsdisp_propput_idx(array, *len+i, &var, ei, caller);
VariantClear(&var); VariantClear(&var);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -170,7 +170,7 @@ static HRESULT concat_obj(DispatchEx *array, IDispatch *obj, DWORD *len, LCID lc ...@@ -170,7 +170,7 @@ static HRESULT concat_obj(DispatchEx *array, IDispatch *obj, DWORD *len, LCID lc
V_VT(&var) = VT_DISPATCH; V_VT(&var) = VT_DISPATCH;
V_DISPATCH(&var) = obj; V_DISPATCH(&var) = obj;
return jsdisp_propput_idx(array, (*len)++, lcid, &var, ei, caller); return jsdisp_propput_idx(array, (*len)++, &var, ei, caller);
} }
static HRESULT Array_concat(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, static HRESULT Array_concat(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp,
...@@ -196,7 +196,7 @@ static HRESULT Array_concat(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM ...@@ -196,7 +196,7 @@ static HRESULT Array_concat(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
if(V_VT(arg) == VT_DISPATCH) if(V_VT(arg) == VT_DISPATCH)
hres = concat_obj(ret, V_DISPATCH(arg), &len, lcid, ei, caller); hres = concat_obj(ret, V_DISPATCH(arg), &len, lcid, ei, caller);
else else
hres = jsdisp_propput_idx(ret, len++, lcid, arg, ei, caller); hres = jsdisp_propput_idx(ret, len++, arg, ei, caller);
if(FAILED(hres)) if(FAILED(hres))
break; break;
} }
...@@ -425,13 +425,13 @@ static HRESULT Array_push(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS ...@@ -425,13 +425,13 @@ static HRESULT Array_push(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
n = arg_cnt(dp); n = arg_cnt(dp);
for(i=0; i < n; i++) { for(i=0; i < n; i++) {
hres = jsdisp_propput_idx(dispex, length+i, lcid, get_arg(dp, i), ei, sp); hres = jsdisp_propput_idx(dispex, length+i, get_arg(dp, i), ei, sp);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }
if(!is_class(dispex, JSCLASS_ARRAY)) { if(!is_class(dispex, JSCLASS_ARRAY)) {
hres = set_jsdisp_length(dispex, lcid, ei, length+n); hres = set_jsdisp_length(dispex, ei, length+n);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }
...@@ -465,7 +465,7 @@ static HRESULT Array_shift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS ...@@ -465,7 +465,7 @@ static HRESULT Array_shift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
}else { }else {
hres = get_jsdisp_length(dispex, lcid, ei, &length); hres = get_jsdisp_length(dispex, lcid, ei, &length);
if(SUCCEEDED(hres) && !length) if(SUCCEEDED(hres) && !length)
hres = set_jsdisp_length(dispex, lcid, ei, 0); hres = set_jsdisp_length(dispex, ei, 0);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }
...@@ -487,13 +487,13 @@ static HRESULT Array_shift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS ...@@ -487,13 +487,13 @@ static HRESULT Array_shift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = jsdisp_delete_idx(dispex, i-1); hres = jsdisp_delete_idx(dispex, i-1);
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
hres = jsdisp_propput_idx(dispex, i-1, lcid, &v, ei, caller); hres = jsdisp_propput_idx(dispex, i-1, &v, ei, caller);
} }
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = jsdisp_delete_idx(dispex, length-1); hres = jsdisp_delete_idx(dispex, length-1);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = set_jsdisp_length(dispex, lcid, ei, length-1); hres = set_jsdisp_length(dispex, ei, length-1);
} }
if(SUCCEEDED(hres) && retv) if(SUCCEEDED(hres) && retv)
...@@ -567,7 +567,7 @@ static HRESULT Array_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS ...@@ -567,7 +567,7 @@ static HRESULT Array_slice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
continue; continue;
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = jsdisp_propput_idx(arr, idx-start, lcid, &v, ei, sp); hres = jsdisp_propput_idx(arr, idx-start, &v, ei, sp);
if(FAILED(hres)) { if(FAILED(hres)) {
jsdisp_release(arr); jsdisp_release(arr);
...@@ -773,7 +773,7 @@ static HRESULT Array_sort(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS ...@@ -773,7 +773,7 @@ static HRESULT Array_sort(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS
} }
for(i=0; SUCCEEDED(hres) && i < length; i++) for(i=0; SUCCEEDED(hres) && i < length; i++)
hres = jsdisp_propput_idx(dispex, i, lcid, sorttab[i], ei, caller); hres = jsdisp_propput_idx(dispex, i, sorttab[i], ei, caller);
} }
if(vtab) { if(vtab) {
...@@ -857,14 +857,14 @@ static HRESULT Array_splice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM ...@@ -857,14 +857,14 @@ static HRESULT Array_splice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = S_OK; hres = S_OK;
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
hres = jsdisp_propput_idx(ret_array, i, lcid, &v, ei, caller); hres = jsdisp_propput_idx(ret_array, i, &v, ei, caller);
} }
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
V_VT(&v) = VT_I4; V_VT(&v) = VT_I4;
V_I4(&v) = delete_cnt; V_I4(&v) = delete_cnt;
hres = jsdisp_propput_name(ret_array, lengthW, lcid, &v, ei, caller); hres = jsdisp_propput_name(ret_array, lengthW, &v, ei, caller);
} }
} }
...@@ -874,7 +874,7 @@ static HRESULT Array_splice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM ...@@ -874,7 +874,7 @@ static HRESULT Array_splice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = jsdisp_delete_idx(dispex, i+add_args); hres = jsdisp_delete_idx(dispex, i+add_args);
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
hres = jsdisp_propput_idx(dispex, i+add_args, lcid, &v, ei, caller); hres = jsdisp_propput_idx(dispex, i+add_args, &v, ei, caller);
} }
for(i=length; SUCCEEDED(hres) && i != length-delete_cnt+add_args; i--) for(i=length; SUCCEEDED(hres) && i != length-delete_cnt+add_args; i--)
...@@ -885,17 +885,17 @@ static HRESULT Array_splice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM ...@@ -885,17 +885,17 @@ static HRESULT Array_splice(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
if(hres == DISP_E_UNKNOWNNAME) if(hres == DISP_E_UNKNOWNNAME)
hres = jsdisp_delete_idx(dispex, i+add_args-1); hres = jsdisp_delete_idx(dispex, i+add_args-1);
else if(SUCCEEDED(hres)) else if(SUCCEEDED(hres))
hres = jsdisp_propput_idx(dispex, i+add_args-1, lcid, &v, ei, caller); hres = jsdisp_propput_idx(dispex, i+add_args-1, &v, ei, caller);
} }
} }
for(i=0; SUCCEEDED(hres) && i < add_args; i++) for(i=0; SUCCEEDED(hres) && i < add_args; i++)
hres = jsdisp_propput_idx(dispex, start+i, lcid, get_arg(dp,i+2), ei, caller); hres = jsdisp_propput_idx(dispex, start+i, get_arg(dp,i+2), ei, caller);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
V_VT(&v) = VT_I4; V_VT(&v) = VT_I4;
V_I4(&v) = length-delete_cnt+add_args; V_I4(&v) = length-delete_cnt+add_args;
hres = jsdisp_propput_name(dispex, lengthW, lcid, &v, ei, caller); hres = jsdisp_propput_name(dispex, lengthW, &v, ei, caller);
} }
if(FAILED(hres)) { if(FAILED(hres)) {
...@@ -972,7 +972,7 @@ static HRESULT Array_unshift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA ...@@ -972,7 +972,7 @@ static HRESULT Array_unshift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = jsdisp_propput_idx(dispex, i+argc, lcid, &var, ei, caller); hres = jsdisp_propput_idx(dispex, i+argc, &var, ei, caller);
VariantClear(&var); VariantClear(&var);
}else if(hres == DISP_E_UNKNOWNNAME) { }else if(hres == DISP_E_UNKNOWNNAME) {
hres = IDispatchEx_DeleteMemberByDispID(_IDispatchEx_(dispex), id); hres = IDispatchEx_DeleteMemberByDispID(_IDispatchEx_(dispex), id);
...@@ -983,13 +983,13 @@ static HRESULT Array_unshift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA ...@@ -983,13 +983,13 @@ static HRESULT Array_unshift(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA
} }
for(i=0; i<argc; i++) { for(i=0; i<argc; i++) {
hres = jsdisp_propput_idx(dispex, i, lcid, get_arg(dp,i), ei, caller); hres = jsdisp_propput_idx(dispex, i, get_arg(dp,i), ei, caller);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }
if(!is_class(dispex, JSCLASS_ARRAY)) { if(!is_class(dispex, JSCLASS_ARRAY)) {
hres = set_jsdisp_length(dispex, lcid, ei, length+argc); hres = set_jsdisp_length(dispex, ei, length+argc);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
} }
...@@ -1099,7 +1099,7 @@ static HRESULT ArrayConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISP ...@@ -1099,7 +1099,7 @@ static HRESULT ArrayConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISP
return hres; return hres;
for(i=0; i < arg_cnt(dp); i++) { for(i=0; i < arg_cnt(dp); i++) {
hres = jsdisp_propput_idx(obj, i, lcid, get_arg(dp, i), ei, caller); hres = jsdisp_propput_idx(obj, i, get_arg(dp, i), ei, caller);
if(FAILED(hres)) if(FAILED(hres))
break; break;
} }
......
...@@ -327,7 +327,7 @@ static HRESULT prop_get(DispatchEx *This, dispex_prop_t *prop, DISPPARAMS *dp, ...@@ -327,7 +327,7 @@ static HRESULT prop_get(DispatchEx *This, dispex_prop_t *prop, DISPPARAMS *dp,
return hres; return hres;
} }
static HRESULT prop_put(DispatchEx *This, dispex_prop_t *prop, LCID lcid, DISPPARAMS *dp, static HRESULT prop_put(DispatchEx *This, dispex_prop_t *prop, DISPPARAMS *dp,
jsexcept_t *ei, IServiceProvider *caller) jsexcept_t *ei, IServiceProvider *caller)
{ {
DWORD i; DWORD i;
...@@ -336,7 +336,7 @@ static HRESULT prop_put(DispatchEx *This, dispex_prop_t *prop, LCID lcid, DISPPA ...@@ -336,7 +336,7 @@ static HRESULT prop_put(DispatchEx *This, dispex_prop_t *prop, LCID lcid, DISPPA
switch(prop->type) { switch(prop->type) {
case PROP_BUILTIN: case PROP_BUILTIN:
if(!(prop->flags & PROPF_METHOD)) if(!(prop->flags & PROPF_METHOD))
return prop->u.p->invoke(This, lcid, DISPATCH_PROPERTYPUT, dp, NULL, ei, caller); return prop->u.p->invoke(This, This->ctx->lcid, DISPATCH_PROPERTYPUT, dp, NULL, ei, caller);
case PROP_PROTREF: case PROP_PROTREF:
prop->type = PROP_VARIANT; prop->type = PROP_VARIANT;
prop->flags = PROPF_ENUM; prop->flags = PROPF_ENUM;
...@@ -559,7 +559,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc ...@@ -559,7 +559,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
hres = prop_get(This, prop, pdp, pvarRes, &jsexcept, pspCaller); hres = prop_get(This, prop, pdp, pvarRes, &jsexcept, pspCaller);
break; break;
case DISPATCH_PROPERTYPUT: case DISPATCH_PROPERTYPUT:
hres = prop_put(This, prop, lcid, pdp, &jsexcept, pspCaller); hres = prop_put(This, prop, pdp, &jsexcept, pspCaller);
break; break;
default: default:
FIXME("Unimplemented flags %x\n", wFlags); FIXME("Unimplemented flags %x\n", wFlags);
...@@ -899,7 +899,7 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DIS ...@@ -899,7 +899,7 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DIS
return hres; return hres;
} }
HRESULT jsdisp_propput_name(DispatchEx *obj, const WCHAR *name, LCID lcid, VARIANT *val, jsexcept_t *ei, IServiceProvider *caller) HRESULT jsdisp_propput_name(DispatchEx *obj, const WCHAR *name, VARIANT *val, jsexcept_t *ei, IServiceProvider *caller)
{ {
DISPID named_arg = DISPID_PROPERTYPUT; DISPID named_arg = DISPID_PROPERTYPUT;
DISPPARAMS dp = {val, &named_arg, 1, 1}; DISPPARAMS dp = {val, &named_arg, 1, 1};
...@@ -910,20 +910,20 @@ HRESULT jsdisp_propput_name(DispatchEx *obj, const WCHAR *name, LCID lcid, VARIA ...@@ -910,20 +910,20 @@ HRESULT jsdisp_propput_name(DispatchEx *obj, const WCHAR *name, LCID lcid, VARIA
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
return prop_put(obj, prop, lcid, &dp, ei, caller); return prop_put(obj, prop, &dp, ei, caller);
} }
HRESULT jsdisp_propput_idx(DispatchEx *obj, DWORD idx, LCID lcid, VARIANT *val, jsexcept_t *ei, IServiceProvider *caller) HRESULT jsdisp_propput_idx(DispatchEx *obj, DWORD idx, VARIANT *val, jsexcept_t *ei, IServiceProvider *caller)
{ {
WCHAR buf[12]; WCHAR buf[12];
static const WCHAR formatW[] = {'%','d',0}; static const WCHAR formatW[] = {'%','d',0};
sprintfW(buf, formatW, idx); sprintfW(buf, formatW, idx);
return jsdisp_propput_name(obj, buf, lcid, val, ei, caller); return jsdisp_propput_name(obj, buf, val, ei, caller);
} }
HRESULT disp_propput(IDispatch *disp, DISPID id, LCID lcid, VARIANT *val, jsexcept_t *ei, IServiceProvider *caller) HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, VARIANT *val, jsexcept_t *ei, IServiceProvider *caller)
{ {
DISPID dispid = DISPID_PROPERTYPUT; DISPID dispid = DISPID_PROPERTYPUT;
DISPPARAMS dp = {val, &dispid, 1, 1}; DISPPARAMS dp = {val, &dispid, 1, 1};
...@@ -937,7 +937,7 @@ HRESULT disp_propput(IDispatch *disp, DISPID id, LCID lcid, VARIANT *val, jsexce ...@@ -937,7 +937,7 @@ HRESULT disp_propput(IDispatch *disp, DISPID id, LCID lcid, VARIANT *val, jsexce
prop = get_prop(jsdisp, id); prop = get_prop(jsdisp, id);
if(prop) if(prop)
hres = prop_put(jsdisp, prop, lcid, &dp, ei, caller); hres = prop_put(jsdisp, prop, &dp, ei, caller);
else else
hres = DISP_E_MEMBERNOTFOUND; hres = DISP_E_MEMBERNOTFOUND;
...@@ -950,10 +950,10 @@ HRESULT disp_propput(IDispatch *disp, DISPID id, LCID lcid, VARIANT *val, jsexce ...@@ -950,10 +950,10 @@ HRESULT disp_propput(IDispatch *disp, DISPID id, LCID lcid, VARIANT *val, jsexce
ULONG err = 0; ULONG err = 0;
TRACE("using IDispatch\n"); TRACE("using IDispatch\n");
return IDispatch_Invoke(disp, id, &IID_NULL, DISPATCH_PROPERTYPUT, lcid, &dp, NULL, &ei->ei, &err); return IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, DISPATCH_PROPERTYPUT, &dp, NULL, &ei->ei, &err);
} }
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_PROPERTYPUT, &dp, NULL, &ei->ei, caller); hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, DISPATCH_PROPERTYPUT, &dp, NULL, &ei->ei, caller);
IDispatchEx_Release(dispex); IDispatchEx_Release(dispex);
return hres; return hres;
......
...@@ -242,7 +242,7 @@ static HRESULT put_value(script_ctx_t *ctx, exprval_t *ref, VARIANT *v, jsexcept ...@@ -242,7 +242,7 @@ static HRESULT put_value(script_ctx_t *ctx, exprval_t *ref, VARIANT *v, jsexcept
if(ref->type != EXPRVAL_IDREF) if(ref->type != EXPRVAL_IDREF)
return throw_reference_error(ctx, ei, IDS_ILLEGAL_ASSIGN, NULL); return throw_reference_error(ctx, ei, IDS_ILLEGAL_ASSIGN, NULL);
return disp_propput(ref->u.idref.disp, ref->u.idref.id, ctx->lcid, v, ei, NULL/*FIXME*/); return disp_propput(ctx, ref->u.idref.disp, ref->u.idref.id, v, ei, NULL/*FIXME*/);
} }
static inline BOOL is_null(const VARIANT *v) static inline BOOL is_null(const VARIANT *v)
...@@ -416,7 +416,7 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so ...@@ -416,7 +416,7 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so
V_VT(&var) = VT_DISPATCH; V_VT(&var) = VT_DISPATCH;
V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(func_obj); V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(func_obj);
hres = jsdisp_propput_name(ctx->var_disp, func->expr->identifier, script->lcid, &var, ei, NULL); hres = jsdisp_propput_name(ctx->var_disp, func->expr->identifier, &var, ei, NULL);
jsdisp_release(func_obj); jsdisp_release(func_obj);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -616,7 +616,7 @@ static HRESULT variable_list_eval(exec_ctx_t *ctx, variable_declaration_t *var_l ...@@ -616,7 +616,7 @@ static HRESULT variable_list_eval(exec_ctx_t *ctx, variable_declaration_t *var_l
if(FAILED(hres)) if(FAILED(hres))
break; break;
hres = jsdisp_propput_name(ctx->var_disp, iter->identifier, ctx->parser->script->lcid, &val, ei, NULL/*FIXME*/); hres = jsdisp_propput_name(ctx->var_disp, iter->identifier, &val, ei, NULL/*FIXME*/);
VariantClear(&val); VariantClear(&val);
if(FAILED(hres)) if(FAILED(hres))
break; break;
...@@ -1163,8 +1163,7 @@ static HRESULT catch_eval(exec_ctx_t *ctx, catch_block_t *block, return_type_t * ...@@ -1163,8 +1163,7 @@ static HRESULT catch_eval(exec_ctx_t *ctx, catch_block_t *block, return_type_t *
hres = create_dispex(ctx->parser->script, NULL, NULL, &var_disp); hres = create_dispex(ctx->parser->script, NULL, NULL, &var_disp);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = jsdisp_propput_name(var_disp, block->identifier, ctx->parser->script->lcid, hres = jsdisp_propput_name(var_disp, block->identifier, &ex, &rt->ei, NULL/*FIXME*/);
&ex, &rt->ei, NULL/*FIXME*/);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = scope_push(ctx->scope_chain, var_disp, &ctx->scope_chain); hres = scope_push(ctx->scope_chain, var_disp, &ctx->scope_chain);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
...@@ -1697,7 +1696,7 @@ HRESULT array_literal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWOR ...@@ -1697,7 +1696,7 @@ HRESULT array_literal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWOR
if(FAILED(hres)) if(FAILED(hres))
break; break;
hres = jsdisp_propput_idx(array, i, ctx->parser->script->lcid, &val, ei, NULL/*FIXME*/); hres = jsdisp_propput_idx(array, i, &val, ei, NULL/*FIXME*/);
VariantClear(&val); VariantClear(&val);
if(FAILED(hres)) if(FAILED(hres))
break; break;
...@@ -1748,7 +1747,7 @@ HRESULT property_value_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWO ...@@ -1748,7 +1747,7 @@ HRESULT property_value_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWO
hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val); hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val);
exprval_release(&exprval); exprval_release(&exprval);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
hres = jsdisp_propput_name(obj, name, ctx->parser->script->lcid, &val, ei, NULL/*FIXME*/); hres = jsdisp_propput_name(obj, name, &val, ei, NULL/*FIXME*/);
VariantClear(&val); VariantClear(&val);
} }
} }
......
...@@ -380,7 +380,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, DispatchEx *object_prototype) ...@@ -380,7 +380,7 @@ HRESULT init_error_constr(script_ctx_t *ctx, DispatchEx *object_prototype)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
hres = jsdisp_propput_name(&err->dispex, nameW, ctx->lcid, &v, NULL/*FIXME*/, NULL/*FIXME*/); hres = jsdisp_propput_name(&err->dispex, nameW, &v, NULL/*FIXME*/, NULL/*FIXME*/);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
hres = create_builtin_function(ctx, constr_val[i], names[i], NULL, hres = create_builtin_function(ctx, constr_val[i], names[i], NULL,
......
...@@ -74,7 +74,7 @@ static HRESULT init_parameters(DispatchEx *var_disp, FunctionInstance *function, ...@@ -74,7 +74,7 @@ static HRESULT init_parameters(DispatchEx *var_disp, FunctionInstance *function,
cargs = arg_cnt(dp); cargs = arg_cnt(dp);
for(param = function->parameters; param; param = param->next) { for(param = function->parameters; param; param = param->next) {
hres = jsdisp_propput_name(var_disp, param->identifier, lcid, hres = jsdisp_propput_name(var_disp, param->identifier,
i < cargs ? get_arg(dp,i) : &var_empty, ei, caller); i < cargs ? get_arg(dp,i) : &var_empty, ei, caller);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
...@@ -121,7 +121,7 @@ static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, LCID lcid, ...@@ -121,7 +121,7 @@ static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, LCID lcid,
} }
for(i=0; i < arg_cnt(dp); i++) { for(i=0; i < arg_cnt(dp); i++) {
hres = jsdisp_propput_idx(args, i, lcid, get_arg(dp,i), ei, caller); hres = jsdisp_propput_idx(args, i, get_arg(dp,i), ei, caller);
if(FAILED(hres)) if(FAILED(hres))
break; break;
} }
...@@ -129,12 +129,12 @@ static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, LCID lcid, ...@@ -129,12 +129,12 @@ static HRESULT create_arguments(script_ctx_t *ctx, IDispatch *calee, LCID lcid,
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
V_VT(&var) = VT_I4; V_VT(&var) = VT_I4;
V_I4(&var) = arg_cnt(dp); V_I4(&var) = arg_cnt(dp);
hres = jsdisp_propput_name(args, lengthW, lcid, &var, ei, caller); hres = jsdisp_propput_name(args, lengthW, &var, ei, caller);
if(SUCCEEDED(hres)) { if(SUCCEEDED(hres)) {
V_VT(&var) = VT_DISPATCH; V_VT(&var) = VT_DISPATCH;
V_DISPATCH(&var) = calee; V_DISPATCH(&var) = calee;
hres = jsdisp_propput_name(args, caleeW, lcid, &var, ei, caller); hres = jsdisp_propput_name(args, caleeW, &var, ei, caller);
} }
} }
...@@ -166,7 +166,7 @@ static HRESULT create_var_disp(FunctionInstance *function, LCID lcid, DISPPARAMS ...@@ -166,7 +166,7 @@ static HRESULT create_var_disp(FunctionInstance *function, LCID lcid, DISPPARAMS
V_VT(&var) = VT_DISPATCH; V_VT(&var) = VT_DISPATCH;
V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(arg_disp); V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(arg_disp);
hres = jsdisp_propput_name(var_disp, argumentsW, lcid, &var, ei, caller); hres = jsdisp_propput_name(var_disp, argumentsW, &var, ei, caller);
jsdisp_release(arg_disp); jsdisp_release(arg_disp);
} }
...@@ -618,7 +618,7 @@ static HRESULT set_prototype(script_ctx_t *ctx, DispatchEx *dispex, DispatchEx * ...@@ -618,7 +618,7 @@ static HRESULT set_prototype(script_ctx_t *ctx, DispatchEx *dispex, DispatchEx *
V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(prototype); V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(prototype);
memset(&jsexcept, 0, sizeof(jsexcept)); memset(&jsexcept, 0, sizeof(jsexcept));
return jsdisp_propput_name(dispex, prototypeW, ctx->lcid, &var, &jsexcept, NULL/*FIXME*/); return jsdisp_propput_name(dispex, prototypeW, &var, &jsexcept, NULL/*FIXME*/);
} }
HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name, HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name,
......
...@@ -887,7 +887,7 @@ HRESULT init_global(script_ctx_t *ctx) ...@@ -887,7 +887,7 @@ HRESULT init_global(script_ctx_t *ctx)
V_VT(&var) = VT_DISPATCH; V_VT(&var) = VT_DISPATCH;
V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(math); V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(math);
hres = jsdisp_propput_name(ctx->global, MathW, ctx->lcid, &var, NULL/*FIXME*/, NULL/*FIXME*/); hres = jsdisp_propput_name(ctx->global, MathW, &var, NULL/*FIXME*/, NULL/*FIXME*/);
jsdisp_release(math); jsdisp_release(math);
return hres; return hres;
......
...@@ -135,10 +135,10 @@ HRESULT jsdisp_call_value(DispatchEx*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,ISer ...@@ -135,10 +135,10 @@ HRESULT jsdisp_call_value(DispatchEx*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,ISer
HRESULT jsdisp_call(DispatchEx*,DISPID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_call(DispatchEx*,DISPID,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT jsdisp_call_name(DispatchEx*,const WCHAR*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_call_name(DispatchEx*,const WCHAR*,WORD,DISPPARAMS*,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT disp_propget(script_ctx_t*,IDispatch*,DISPID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT disp_propget(script_ctx_t*,IDispatch*,DISPID,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT disp_propput(IDispatch*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT jsdisp_propget(DispatchEx*,DISPID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propget(DispatchEx*,DISPID,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT jsdisp_propput_name(DispatchEx*,const WCHAR*,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propput_name(DispatchEx*,const WCHAR*,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT jsdisp_propput_idx(DispatchEx*,DWORD,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propput_idx(DispatchEx*,DWORD,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT jsdisp_propget_name(DispatchEx*,LPCWSTR,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propget_name(DispatchEx*,LPCWSTR,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT jsdisp_propget_idx(DispatchEx*,DWORD,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propget_idx(DispatchEx*,DWORD,VARIANT*,jsexcept_t*,IServiceProvider*);
HRESULT jsdisp_get_id(DispatchEx*,const WCHAR*,DWORD,DISPID*); HRESULT jsdisp_get_id(DispatchEx*,const WCHAR*,DWORD,DISPID*);
......
...@@ -3520,7 +3520,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res ...@@ -3520,7 +3520,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res
break; break;
} }
hres = jsdisp_propput_idx(array, i+1, lcid, &var, ei, NULL/*FIXME*/); hres = jsdisp_propput_idx(array, i+1, &var, ei, NULL/*FIXME*/);
SysFreeString(V_BSTR(&var)); SysFreeString(V_BSTR(&var));
if(FAILED(hres)) if(FAILED(hres))
break; break;
...@@ -3529,13 +3529,13 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res ...@@ -3529,13 +3529,13 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res
while(SUCCEEDED(hres)) { while(SUCCEEDED(hres)) {
V_VT(&var) = VT_I4; V_VT(&var) = VT_I4;
V_I4(&var) = result->str-input; V_I4(&var) = result->str-input;
hres = jsdisp_propput_name(array, indexW, lcid, &var, ei, NULL/*FIXME*/); hres = jsdisp_propput_name(array, indexW, &var, ei, NULL/*FIXME*/);
if(FAILED(hres)) if(FAILED(hres))
break; break;
V_VT(&var) = VT_BSTR; V_VT(&var) = VT_BSTR;
V_BSTR(&var) = input; V_BSTR(&var) = input;
hres = jsdisp_propput_name(array, inputW, lcid, &var, ei, NULL/*FIXME*/); hres = jsdisp_propput_name(array, inputW, &var, ei, NULL/*FIXME*/);
if(FAILED(hres)) if(FAILED(hres))
break; break;
...@@ -3544,7 +3544,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res ...@@ -3544,7 +3544,7 @@ static HRESULT create_match_array(script_ctx_t *ctx, BSTR input, const match_res
hres = E_OUTOFMEMORY; hres = E_OUTOFMEMORY;
break; break;
} }
hres = jsdisp_propput_name(array, zeroW, lcid, &var, ei, NULL/*FIXME*/); hres = jsdisp_propput_name(array, zeroW, &var, ei, NULL/*FIXME*/);
SysFreeString(V_BSTR(&var)); SysFreeString(V_BSTR(&var));
break; break;
} }
......
...@@ -758,7 +758,7 @@ static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM ...@@ -758,7 +758,7 @@ static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
break; break;
} }
hres = jsdisp_propput_idx(array, i, lcid, &var, ei, NULL/*FIXME*/); hres = jsdisp_propput_idx(array, i, &var, ei, NULL/*FIXME*/);
SysFreeString(V_BSTR(&var)); SysFreeString(V_BSTR(&var));
if(FAILED(hres)) if(FAILED(hres))
break; break;
...@@ -1313,7 +1313,7 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM ...@@ -1313,7 +1313,7 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
break; break;
} }
hres = jsdisp_propput_idx(array, i, lcid, &var, ei, sp); hres = jsdisp_propput_idx(array, i, &var, ei, sp);
SysFreeString(V_BSTR(&var)); SysFreeString(V_BSTR(&var));
if(FAILED(hres)) if(FAILED(hres))
break; break;
...@@ -1335,7 +1335,7 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM ...@@ -1335,7 +1335,7 @@ static HRESULT String_split(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAM
V_BSTR(&var) = SysAllocStringLen(ptr, len); V_BSTR(&var) = SysAllocStringLen(ptr, len);
if(V_BSTR(&var)) { if(V_BSTR(&var)) {
hres = jsdisp_propput_idx(array, i, lcid, &var, ei, sp); hres = jsdisp_propput_idx(array, i, &var, ei, sp);
SysFreeString(V_BSTR(&var)); SysFreeString(V_BSTR(&var));
}else { }else {
hres = E_OUTOFMEMORY; hres = E_OUTOFMEMORY;
......
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