jscript: Use jsdisp_define_data_property in Object.getOwnPropertyDescriptor.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-06-11 15:54:26 +02:00 committed by Alexandre Julliard
parent e45e675b73
commit b0cce16c7a
2 changed files with 14 additions and 12 deletions

View File

@ -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

View File

@ -493,22 +493,22 @@ 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,
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,
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,
hres = jsdisp_define_data_property(desc_obj, configurableW, PROPF_ALL,
jsval_bool(!!(prop_desc.flags & PROPF_CONFIGURABLE)));
release_property_descriptor(&prop_desc);