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:
parent
e45e675b73
commit
b0cce16c7a
|
@ -90,10 +90,12 @@ extern HINSTANCE jscript_hinstance DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
#define PROPF_ARGMASK 0x00ff
|
#define PROPF_ARGMASK 0x00ff
|
||||||
#define PROPF_METHOD 0x0100
|
#define PROPF_METHOD 0x0100
|
||||||
#define PROPF_ENUMERABLE 0x0200
|
#define PROPF_CONSTR 0x0200
|
||||||
#define PROPF_CONSTR 0x0400
|
|
||||||
|
#define PROPF_ENUMERABLE 0x0400
|
||||||
#define PROPF_WRITABLE 0x0800
|
#define PROPF_WRITABLE 0x0800
|
||||||
#define PROPF_CONFIGURABLE 0x1000
|
#define PROPF_CONFIGURABLE 0x1000
|
||||||
|
#define PROPF_ALL (PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE)
|
||||||
|
|
||||||
#define PROPF_VERSION_MASK 0x01ff0000
|
#define PROPF_VERSION_MASK 0x01ff0000
|
||||||
#define PROPF_VERSION_SHIFT 16
|
#define PROPF_VERSION_SHIFT 16
|
||||||
|
|
|
@ -493,23 +493,23 @@ static HRESULT Object_getOwnPropertyDescriptor(script_ctx_t *ctx, vdisp_t *jsthi
|
||||||
return hres;
|
return hres;
|
||||||
|
|
||||||
if(prop_desc.explicit_getter || prop_desc.explicit_setter) {
|
if(prop_desc.explicit_getter || prop_desc.explicit_setter) {
|
||||||
hres = jsdisp_propput_name(desc_obj, getW, prop_desc.getter
|
hres = jsdisp_define_data_property(desc_obj, getW, PROPF_ALL,
|
||||||
? jsval_obj(prop_desc.getter) : jsval_undefined());
|
prop_desc.getter ? jsval_obj(prop_desc.getter) : jsval_undefined());
|
||||||
if(SUCCEEDED(hres))
|
if(SUCCEEDED(hres))
|
||||||
hres = jsdisp_propput_name(desc_obj, setW, prop_desc.setter
|
hres = jsdisp_define_data_property(desc_obj, setW, PROPF_ALL,
|
||||||
? jsval_obj(prop_desc.setter) : jsval_undefined());
|
prop_desc.setter ? jsval_obj(prop_desc.setter) : jsval_undefined());
|
||||||
}else {
|
}else {
|
||||||
hres = jsdisp_propput_name(desc_obj, valueW, prop_desc.value);
|
hres = jsdisp_propput_name(desc_obj, valueW, prop_desc.value);
|
||||||
if(SUCCEEDED(hres))
|
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)));
|
jsval_bool(!!(prop_desc.flags & PROPF_WRITABLE)));
|
||||||
}
|
}
|
||||||
if(SUCCEEDED(hres))
|
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)));
|
jsval_bool(!!(prop_desc.flags & PROPF_ENUMERABLE)));
|
||||||
if(SUCCEEDED(hres))
|
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)));
|
jsval_bool(!!(prop_desc.flags & PROPF_CONFIGURABLE)));
|
||||||
|
|
||||||
release_property_descriptor(&prop_desc);
|
release_property_descriptor(&prop_desc);
|
||||||
if(SUCCEEDED(hres) && r)
|
if(SUCCEEDED(hres) && r)
|
||||||
|
|
Loading…
Reference in New Issue