From b0cce16c7a390c3ce5e3f800a8c50f34425e9072 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 11 Jun 2018 15:54:26 +0200 Subject: [PATCH] jscript: Use jsdisp_define_data_property in Object.getOwnPropertyDescriptor. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/jscript/jscript.h | 6 ++++-- dlls/jscript/object.c | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 5a7be8ead1c..1cb6d159a8b 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -90,10 +90,12 @@ extern HINSTANCE jscript_hinstance DECLSPEC_HIDDEN; #define PROPF_ARGMASK 0x00ff #define PROPF_METHOD 0x0100 -#define PROPF_ENUMERABLE 0x0200 -#define PROPF_CONSTR 0x0400 +#define PROPF_CONSTR 0x0200 + +#define PROPF_ENUMERABLE 0x0400 #define PROPF_WRITABLE 0x0800 #define PROPF_CONFIGURABLE 0x1000 +#define PROPF_ALL (PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE) #define PROPF_VERSION_MASK 0x01ff0000 #define PROPF_VERSION_SHIFT 16 diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index d18f1c9c00d..94289315258 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -493,23 +493,23 @@ static HRESULT Object_getOwnPropertyDescriptor(script_ctx_t *ctx, vdisp_t *jsthi return hres; if(prop_desc.explicit_getter || prop_desc.explicit_setter) { - hres = jsdisp_propput_name(desc_obj, getW, prop_desc.getter - ? jsval_obj(prop_desc.getter) : jsval_undefined()); + hres = jsdisp_define_data_property(desc_obj, getW, PROPF_ALL, + prop_desc.getter ? jsval_obj(prop_desc.getter) : jsval_undefined()); if(SUCCEEDED(hres)) - hres = jsdisp_propput_name(desc_obj, setW, prop_desc.setter - ? jsval_obj(prop_desc.setter) : jsval_undefined()); + hres = jsdisp_define_data_property(desc_obj, setW, PROPF_ALL, + prop_desc.setter ? jsval_obj(prop_desc.setter) : jsval_undefined()); }else { hres = jsdisp_propput_name(desc_obj, valueW, prop_desc.value); if(SUCCEEDED(hres)) - hres = jsdisp_propput_name(desc_obj, writableW, - jsval_bool(!!(prop_desc.flags & PROPF_WRITABLE))); + hres = jsdisp_define_data_property(desc_obj, writableW, PROPF_ALL, + jsval_bool(!!(prop_desc.flags & PROPF_WRITABLE))); } if(SUCCEEDED(hres)) - hres = jsdisp_propput_name(desc_obj, enumerableW, - jsval_bool(!!(prop_desc.flags & PROPF_ENUMERABLE))); + hres = jsdisp_define_data_property(desc_obj, enumerableW, PROPF_ALL, + jsval_bool(!!(prop_desc.flags & PROPF_ENUMERABLE))); if(SUCCEEDED(hres)) - hres = jsdisp_propput_name(desc_obj, configurableW, - jsval_bool(!!(prop_desc.flags & PROPF_CONFIGURABLE))); + hres = jsdisp_define_data_property(desc_obj, configurableW, PROPF_ALL, + jsval_bool(!!(prop_desc.flags & PROPF_CONFIGURABLE))); release_property_descriptor(&prop_desc); if(SUCCEEDED(hres) && r)