Module: wine Branch: master Commit: 4555828c57c918d99cd91fcb469b8ebda243f5b0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=4555828c57c918d99cd91fcb4...
Author: Jacek Caban jacek@codeweavers.com Date: Fri May 11 14:43:28 2018 +0200
jscript: Use jsdisp_define_property instead of jsdisp_propput_const.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/jscript/dispex.c | 6 ++++++ dlls/jscript/function.c | 3 ++- dlls/jscript/jscript.h | 2 +- dlls/jscript/math.c | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 7a2879a..714f3a4 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -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); +} diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index af0b9a4..040bcc5 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -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)) { diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 2beee26..40e99f3 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -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; diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c index ef906f5..109df9d 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -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;