Commit 4555828c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

jscript: Use jsdisp_define_property instead of jsdisp_propput_const.

parent 83de7691
......@@ -1701,3 +1701,9 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t
prop->flags = (prop->flags & ~desc->mask) | (desc->flags & desc->mask);
return S_OK;
}
HRESULT jsdisp_define_data_property(jsdisp_t *obj, const WCHAR *name, unsigned flags, jsval_t value)
{
property_desc_t prop_desc = { flags, flags, TRUE, value };
return jsdisp_define_property(obj, name, &prop_desc);
}
......@@ -655,7 +655,8 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc,
return hres;
if(builtin_info)
hres = jsdisp_propput_const(&function->dispex, lengthW, jsval_number(function->length));
hres = jsdisp_define_data_property(&function->dispex, lengthW, 0,
jsval_number(function->length));
if(SUCCEEDED(hres))
hres = set_prototype(ctx, &function->dispex, prototype);
if(FAILED(hres)) {
......
......@@ -284,7 +284,6 @@ HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget(jsdisp_t*,DISPID,jsval_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput(jsdisp_t*,const WCHAR*,DWORD,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_name(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_const(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_dontenum(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propput_idx(jsdisp_t*,DWORD,jsval_t) DECLSPEC_HIDDEN;
HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,jsval_t*) DECLSPEC_HIDDEN;
......@@ -295,6 +294,7 @@ HRESULT disp_delete_name(script_ctx_t*,IDispatch*,jsstr_t*,BOOL*) DECLSPEC_HIDDE
HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD) DECLSPEC_HIDDEN;
HRESULT jsdisp_get_own_property(jsdisp_t*,const WCHAR*,BOOL,property_desc_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_define_property(jsdisp_t*,const WCHAR*,property_desc_t*) DECLSPEC_HIDDEN;
HRESULT jsdisp_define_data_property(jsdisp_t*,const WCHAR*,unsigned,jsval_t) 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;
......
......@@ -559,7 +559,8 @@ HRESULT create_math(script_ctx_t *ctx, jsdisp_t **ret)
}
for(i=0; i < sizeof(constants)/sizeof(*constants); i++) {
hres = jsdisp_propput_const(math, constants[i].name, jsval_number(constants[i].val));
hres = jsdisp_define_data_property(math, constants[i].name, 0,
jsval_number(constants[i].val));
if(FAILED(hres)) {
jsdisp_release(math);
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