From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/dispex.c | 53 +++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 15 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 54e54cfdc96..c1087d37ab4 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -2299,33 +2299,56 @@ static HRESULT WINAPI JSDispatchHost_GetJSDispatch(IWineJSDispatchHost *iface, I return S_OK; }
+static HRESULT get_host_property_descriptor(DispatchEx *This, DISPID id, struct property_info *desc) +{ + HRESULT hres; + + desc->id = id; + + switch(get_dispid_type(id)) { + case DISPEXPROP_BUILTIN: { + func_info_t *func; + + hres = get_builtin_func(This->info, id, &func); + if(FAILED(hres)) + return hres; + desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE; + desc->name = func->name; + if(func->func_disp_idx < 0) { + desc->flags |= PROPF_ENUMERABLE; + desc->func_iid = 0; + }else { + desc->func_iid = func->tid; + } + break; + } + case DISPEXPROP_DYNAMIC: + desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE | PROPF_ENUMERABLE; + desc->name = This->dynamic_data->props[id - DISPID_DYNPROP_0].name; + desc->func_iid = 0; + break; + case DISPEXPROP_CUSTOM: + FIXME("custom properties not yet supported\n"); + return E_NOTIMPL; + } + + return S_OK; +} + static HRESULT WINAPI JSDispatchHost_LookupProperty(IWineJSDispatchHost *iface, const WCHAR *name, DWORD flags, struct property_info *desc) { DispatchEx *This = impl_from_IWineJSDispatchHost(iface); - func_info_t *func; DISPID id; HRESULT hres;
TRACE("%s (%p)->(%s)\n", This->info->desc->name, This, debugstr_w(name));
- hres = get_builtin_id(This, name, flags, &id); + hres = dispex_get_id(This, name, flags, &id); if(FAILED(hres)) return hres;
- hres = get_builtin_func(This->info, id, &func); - if(FAILED(hres)) - return hres; - desc->id = id; - desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE; - if(func->func_disp_idx < 0) { - desc->flags |= PROPF_ENUMERABLE; - desc->func_iid = 0; - }else { - desc->func_iid = func->tid; - } - desc->name = func->name; - return S_OK; + return get_host_property_descriptor(This, id, desc); }
static HRESULT WINAPI JSDispatchHost_NextProperty(IWineJSDispatchHost *iface, DISPID id, struct property_info *desc)
From: Jacek Caban jacek@codeweavers.com
And use it in HTMLRectCollection instead of get_name. --- dlls/mshtml/dispex.c | 26 ++++++++++++++++++++++++++ dlls/mshtml/htmlelem.c | 17 +---------------- dlls/mshtml/mshtml_private.h | 2 ++ 3 files changed, 29 insertions(+), 16 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index c1087d37ab4..cacf79322d8 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -2169,6 +2169,20 @@ HRESULT dispex_prop_name(DispatchEx *dispex, DISPID id, BSTR *ret) HRESULT hres;
if(is_custom_dispid(id)) { + if(dispex->info->desc->vtbl->get_prop_desc) { + struct property_info desc; + WCHAR buf[12]; + + hres = dispex->info->desc->vtbl->get_prop_desc(dispex, id, &desc); + if(FAILED(hres)) + return hres; + if(!desc.name) { + swprintf(buf, ARRAYSIZE(buf), L"%u", desc.index); + desc.name = buf; + } + *ret = SysAllocString(desc.name); + return *ret ? S_OK : E_OUTOFMEMORY; + } if(dispex->info->desc->vtbl->get_name) return dispex->info->desc->vtbl->get_name(dispex, id, ret); return DISP_E_MEMBERNOTFOUND; @@ -2299,6 +2313,18 @@ static HRESULT WINAPI JSDispatchHost_GetJSDispatch(IWineJSDispatchHost *iface, I return S_OK; }
+HRESULT dispex_index_prop_desc(DispatchEx *dispex, DISPID id, struct property_info *desc) +{ + desc->id = id; + desc->flags = PROPF_WRITABLE | PROPF_CONFIGURABLE; + if(dispex->info->desc->vtbl->next_dispid) + desc->flags |= PROPF_ENUMERABLE; + desc->name = NULL; + desc->index = id - MSHTML_DISPID_CUSTOM_MIN; + desc->func_iid = 0; + return S_OK; +} + static HRESULT get_host_property_descriptor(DispatchEx *This, DISPID id, struct property_info *desc) { HRESULT hres; diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 3e45ab5cb0e..24d3302275e 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -1073,21 +1073,6 @@ static HRESULT HTMLRectCollection_get_dispid(DispatchEx *dispex, const WCHAR *na return S_OK; }
-static HRESULT HTMLRectCollection_get_name(DispatchEx *dispex, DISPID id, BSTR *name) -{ - HTMLRectCollection *This = HTMLRectCollection_from_DispatchEx(dispex); - DWORD idx = id - MSHTML_DISPID_CUSTOM_MIN; - UINT32 len = 0; - WCHAR buf[11]; - - nsIDOMClientRectList_GetLength(This->rect_list, &len); - if(idx >= len) - return DISP_E_MEMBERNOTFOUND; - - len = swprintf(buf, ARRAY_SIZE(buf), L"%u", idx); - return (*name = SysAllocStringLen(buf, len)) ? S_OK : E_OUTOFMEMORY; -} - static HRESULT HTMLRectCollection_invoke(DispatchEx *dispex, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params, VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller) { @@ -1132,7 +1117,7 @@ static const dispex_static_data_vtbl_t HTMLRectCollection_dispex_vtbl = { .traverse = HTMLRectCollection_traverse, .unlink = HTMLRectCollection_unlink, .get_dispid = HTMLRectCollection_get_dispid, - .get_name = HTMLRectCollection_get_name, + .get_prop_desc = dispex_index_prop_desc, .invoke = HTMLRectCollection_invoke, }; static const tid_t HTMLRectCollection_iface_tids[] = { diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index a7a6a2ed0a2..4e6a79108bb 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -392,6 +392,7 @@ typedef struct { HRESULT (*invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); HRESULT (*delete)(DispatchEx*,DISPID); HRESULT (*next_dispid)(DispatchEx*,DISPID,DISPID*); + HRESULT (*get_prop_desc)(DispatchEx*,DISPID,struct property_info*);
/* Similar to invoke, but allows overriding all dispids */ HRESULT (*disp_invoke)(DispatchEx*,DISPID,LCID,WORD,DISPPARAMS*,VARIANT*,EXCEPINFO*,IServiceProvider*); @@ -515,6 +516,7 @@ HRESULT dispex_prop_put(DispatchEx *dispex, DISPID id, LCID lcid, VARIANT *v, EX HRESULT dispex_get_id(DispatchEx *dispex, const WCHAR *name, DWORD flags, DISPID *pid); HRESULT dispex_next_id(DispatchEx *dispex, DISPID id, DISPID *ret); HRESULT dispex_prop_name(DispatchEx *dispex, DISPID id, BSTR *ret); +HRESULT dispex_index_prop_desc(DispatchEx*,DISPID,struct property_info*);
typedef enum { DISPEXPROP_CUSTOM,
From: Jacek Caban jacek@codeweavers.com
--- dlls/mshtml/dispex.c | 3 +-- dlls/mshtml/htmlelem.c | 2 +- dlls/mshtml/tests/documentmode.js | 2 +- dlls/mshtml/tests/dom.js | 12 ++++++++++++ 4 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index cacf79322d8..fd7d571aebd 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -2354,8 +2354,7 @@ static HRESULT get_host_property_descriptor(DispatchEx *This, DISPID id, struct desc->func_iid = 0; break; case DISPEXPROP_CUSTOM: - FIXME("custom properties not yet supported\n"); - return E_NOTIMPL; + return This->info->desc->vtbl->get_prop_desc(This, id, desc); }
return S_OK; diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 24d3302275e..7fea9065659 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -3038,7 +3038,7 @@ static HRESULT WINAPI HTMLElement2_getClientRects(IHTMLElement2 *iface, IHTMLRec
rects->IHTMLRectCollection_iface.lpVtbl = &HTMLRectCollectionVtbl; rects->rect_list = rect_list; - init_dispatch(&rects->dispex, &HTMLRectCollection_dispex, NULL, + init_dispatch(&rects->dispex, &HTMLRectCollection_dispex, This->node.doc->script_global, dispex_compat_mode(&This->node.event_target.dispex));
*pRectCol = &rects->IHTMLRectCollection_iface; diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 016b51c9eda..404452b2068 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -294,7 +294,7 @@ sync_test("builtin_toString", function() { if(false /* todo_wine */) test("attributes", e.attributes, "NamedNodeMap"); test("childNodes", document.body.childNodes, "NodeList", null, true); if(clientRects) test("clientRect", clientRects[0], "ClientRect", null, true); - if(clientRects) test("clientRects", clientRects, "ClientRectList", null, true); + if(clientRects) test("clientRects", clientRects, "ClientRectList"); if(currentStyle) test("currentStyle", currentStyle, "MSCurrentStyleCSSProperties", null, true); if(v >= 11 /* todo_wine */) test("document", document, v < 11 ? "Document" : "HTMLDocument", null, true); test("elements", document.getElementsByTagName("body"), "HTMLCollection", null, true); diff --git a/dlls/mshtml/tests/dom.js b/dlls/mshtml/tests/dom.js index 325cacf4823..8cecd164b6d 100644 --- a/dlls/mshtml/tests/dom.js +++ b/dlls/mshtml/tests/dom.js @@ -331,6 +331,18 @@ sync_test("rects", function() { ok(rects.length === 1, "rect.length = " + rects.length); ok(rects[0].top === rect.top, "rects[0].top = " + rects[0].top + " rect.top = " + rect.top); ok(rects[0].bottom === rect.bottom, "rects[0].bottom = " + rects[0].bottom + " rect.bottom = " + rect.bottom); + + ok("" + rects[0] === "[object ClientRect]", "rects[0] = " + rects[0]); + ok(rects.hasOwnProperty("0"), 'rects.hasOwnProperty("0") = ' + rects.hasOwnProperty("0")); + todo_wine. + ok(rects.hasOwnProperty("1"), 'rects.hasOwnProperty("1") = ' + rects.hasOwnProperty("1")); + var desc = Object.getOwnPropertyDescriptor(rects, "0"); + ok(desc.writable === true, "writable = " + desc.writable); + todo_wine. + ok(desc.enumerable === true, "enumerable = " + desc.enumerable); + ok(desc.configurable === true, "configurable = " + desc.configurable); + ok("" + desc.value === "[object ClientRect]", "desc.value = " + desc.value); + ok(rect.height === rect.bottom - rect.top, "rect.height = " + rect.height + " rect.bottom = " + rect.bottom + " rect.top = " + rect.top); ok(rect.width === rect.right - rect.left, "rect.width = " + rect.width + " rect.right = " + rect.right + " rect.left = " + rect.left);
From: Jacek Caban jacek@codeweavers.com
It may have a different name for case insensitive searches. --- dlls/jscript/dispex.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 79aea60de9c..7d77ce6a47f 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -369,41 +369,44 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name,
static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret) { - dispex_prop_t *prop, *del=NULL; + dispex_prop_t *prot_prop, *own_prop; HRESULT hres;
- hres = find_prop_name(This, hash, name, case_insens, &prop); + hres = find_prop_name(This, hash, name, case_insens, &own_prop); if(FAILED(hres)) return hres; - if(prop && prop->type==PROP_DELETED) { - del = prop; - } else if(prop) { - fix_protref_prop(This, prop); - *ret = prop; + if(own_prop && own_prop->type != PROP_DELETED) { + fix_protref_prop(This, own_prop); + *ret = own_prop; return S_OK; }
if(This->prototype) { - hres = find_prop_name_prot(This->prototype, hash, name, case_insens, &prop); + hres = find_prop_name_prot(This->prototype, hash, name, case_insens, &prot_prop); if(FAILED(hres)) return hres; - if(prop && prop->type != PROP_DELETED) { - if(del) { - del->type = PROP_PROTREF; - del->u.ref = prop - This->prototype->props; - prop = del; + if(prot_prop && prot_prop->type != PROP_DELETED) { + if(own_prop && case_insens && wcscmp(prot_prop->name, own_prop->name)) { + hres = find_prop_name(This, prot_prop->hash, prot_prop->name, FALSE, &own_prop); + if(FAILED(hres)) + return hres; + if(own_prop && own_prop->type != PROP_DELETED) { + *ret = own_prop; + return S_OK; + } + } + if(own_prop) { + own_prop->type = PROP_PROTREF; + own_prop->u.ref = prot_prop - This->prototype->props; }else { - prop = alloc_protref(This, prop->name, prop - This->prototype->props); - if(!prop) + own_prop = alloc_protref(This, prot_prop->name, prot_prop - This->prototype->props); + if(!own_prop) return E_OUTOFMEMORY; } - - *ret = prop; - return S_OK; } }
- *ret = del; + *ret = own_prop; return S_OK; }
From: Jacek Caban jacek@codeweavers.com
Instead of using fix_protref_prot. --- dlls/jscript/dispex.c | 57 ++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 25 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 7d77ce6a47f..436fc8e1e69 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -318,13 +318,14 @@ static HRESULT find_external_prop(jsdisp_t *This, const WCHAR *name, BOOL case_i return S_OK; }
-static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret) +static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, + dispex_prop_t *prop, dispex_prop_t **ret) { const builtin_prop_t *builtin; - dispex_prop_t *prop; HRESULT hres;
- prop = lookup_dispex_prop(This, hash, name, case_insens); + if(!prop) + prop = lookup_dispex_prop(This, hash, name, case_insens); if(prop && prop->type != PROP_DELETED) { *ret = prop; return S_OK; @@ -367,27 +368,31 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, return hres; }
-static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, dispex_prop_t **ret) +static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *name, BOOL case_insens, + dispex_prop_t *own_prop, dispex_prop_t **ret) { - dispex_prop_t *prot_prop, *own_prop; + dispex_prop_t *prot_prop = NULL; HRESULT hres;
- hres = find_prop_name(This, hash, name, case_insens, &own_prop); + hres = find_prop_name(This, hash, name, case_insens, own_prop, &own_prop); if(FAILED(hres)) return hres; - if(own_prop && own_prop->type != PROP_DELETED) { - fix_protref_prop(This, own_prop); - *ret = own_prop; - return S_OK; + if(own_prop) { + if(own_prop->type == PROP_PROTREF) { + prot_prop = &This->prototype->props[own_prop->u.ref]; + }else if(own_prop->type != PROP_DELETED) { + *ret = own_prop; + return S_OK; + } }
if(This->prototype) { - hres = find_prop_name_prot(This->prototype, hash, name, case_insens, &prot_prop); + hres = find_prop_name_prot(This->prototype, hash, name, case_insens, prot_prop, &prot_prop); if(FAILED(hres)) return hres; if(prot_prop && prot_prop->type != PROP_DELETED) { if(own_prop && case_insens && wcscmp(prot_prop->name, own_prop->name)) { - hres = find_prop_name(This, prot_prop->hash, prot_prop->name, FALSE, &own_prop); + hres = find_prop_name(This, prot_prop->hash, prot_prop->name, FALSE, NULL, &own_prop); if(FAILED(hres)) return hres; if(own_prop && own_prop->type != PROP_DELETED) { @@ -403,6 +408,8 @@ static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *n if(!own_prop) return E_OUTOFMEMORY; } + }else if(own_prop) { + own_prop->type = PROP_DELETED; } }
@@ -415,7 +422,7 @@ static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_ dispex_prop_t *prop; HRESULT hres;
- hres = find_prop_name_prot(This, string_hash(name), name, case_insens, &prop); + hres = find_prop_name_prot(This, string_hash(name), name, case_insens, NULL, &prop); if(SUCCEEDED(hres) && (!prop || prop->type == PROP_DELETED)) { TRACE("creating prop %s flags %lx\n", debugstr_w(name), create_flags);
@@ -745,7 +752,7 @@ static HRESULT fill_protrefs(jsdisp_t *This) return hres;
for(iter = This->prototype->props; iter < This->prototype->props+This->prototype->prop_cnt; iter++) { - hres = find_prop_name(This, iter->hash, iter->name, FALSE, &prop); + hres = find_prop_name(This, iter->hash, iter->name, FALSE, NULL, &prop); if(FAILED(hres)) return hres; if(!prop || prop->type==PROP_DELETED) { @@ -2233,7 +2240,7 @@ static HRESULT WINAPI DispatchEx_DeleteMemberByName(IWineJSDispatch *iface, BSTR if(grfdex & ~(fdexNameCaseSensitive|fdexNameCaseInsensitive|fdexNameEnsure|fdexNameImplicit|FDEX_VERSION_MASK)) FIXME("Unsupported grfdex %lx\n", grfdex);
- hres = find_prop_name(This, string_hash(bstrName), bstrName, grfdex & fdexNameCaseInsensitive, &prop); + hres = find_prop_name(This, string_hash(bstrName), bstrName, grfdex & fdexNameCaseInsensitive, NULL, &prop); if(FAILED(hres)) return hres; if(!prop) { @@ -2423,7 +2430,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built dispex_prop_t *prop; HRESULT hres;
- hres = find_prop_name_prot(constr, string_hash(L"prototype"), L"prototype", FALSE, &prop); + hres = find_prop_name_prot(constr, string_hash(L"prototype"), L"prototype", FALSE, NULL, &prop); if(SUCCEEDED(hres) && prop && prop->type!=PROP_DELETED) { jsval_t val;
@@ -2464,7 +2471,7 @@ HRESULT jsdisp_get_id(jsdisp_t *jsdisp, const WCHAR *name, DWORD flags, DISPID * hres = ensure_prop_name(jsdisp, name, PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE, flags & fdexNameCaseInsensitive, &prop); else - hres = find_prop_name_prot(jsdisp, string_hash(name), name, flags & fdexNameCaseInsensitive, &prop); + hres = find_prop_name_prot(jsdisp, string_hash(name), name, flags & fdexNameCaseInsensitive, NULL, &prop); if(FAILED(hres)) return hres;
@@ -2525,7 +2532,7 @@ HRESULT jsdisp_call_name(jsdisp_t *disp, const WCHAR *name, WORD flags, unsigned dispex_prop_t *prop; HRESULT hres;
- hres = find_prop_name_prot(disp, string_hash(name), name, FALSE, &prop); + hres = find_prop_name_prot(disp, string_hash(name), name, FALSE, NULL, &prop); if(FAILED(hres)) return hres;
@@ -2755,7 +2762,7 @@ HRESULT jsdisp_propput(jsdisp_t *obj, const WCHAR *name, DWORD flags, BOOL throw if(obj->extensible) hres = ensure_prop_name(obj, name, flags, FALSE, &prop); else - hres = find_prop_name(obj, string_hash(name), name, FALSE, &prop); + hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &prop); if(FAILED(hres)) return hres; if(!prop || (prop->type == PROP_DELETED && !obj->extensible)) @@ -2856,7 +2863,7 @@ HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val) dispex_prop_t *prop; HRESULT hres;
- hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, &prop); + hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, NULL, &prop); if(FAILED(hres)) return hres;
@@ -2876,7 +2883,7 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
swprintf(name, ARRAY_SIZE(name), L"%d", idx);
- hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, &prop); + hres = find_prop_name_prot(obj, string_hash(name), name, FALSE, NULL, &prop); if(FAILED(hres)) return hres;
@@ -2933,7 +2940,7 @@ HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
swprintf(buf, ARRAY_SIZE(buf), L"%d", idx);
- hres = find_prop_name(obj, string_hash(buf), buf, FALSE, &prop); + hres = find_prop_name(obj, string_hash(buf), buf, FALSE, NULL, &prop); if(FAILED(hres) || !prop) return hres;
@@ -3029,7 +3036,7 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL return E_OUTOFMEMORY; }
- hres = find_prop_name(jsdisp, string_hash(ptr), ptr, FALSE, &prop); + hres = find_prop_name(jsdisp, string_hash(ptr), ptr, FALSE, NULL, &prop); if(prop) { hres = delete_prop(prop, ret); }else { @@ -3076,7 +3083,7 @@ HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_onl dispex_prop_t *prop; HRESULT hres;
- hres = find_prop_name(obj, string_hash(name), name, FALSE, &prop); + hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &prop); if(FAILED(hres)) return hres;
@@ -3120,7 +3127,7 @@ HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t dispex_prop_t *prop; HRESULT hres;
- hres = find_prop_name(obj, string_hash(name), name, FALSE, &prop); + hres = find_prop_name(obj, string_hash(name), name, FALSE, NULL, &prop); if(FAILED(hres)) return hres;
From: Jacek Caban jacek@codeweavers.com
To avoid falling into JSCLASS_OBJECT special-case in disp_call_value_with_caller. --- dlls/jscript/dispex.c | 2 +- dlls/jscript/jscript.h | 1 + dlls/jscript/object.c | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 436fc8e1e69..0e8650f12e5 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -3418,7 +3418,7 @@ static HRESULT HostObject_to_string(jsdisp_t *jsdisp, jsstr_t **ret) }
static const builtin_info_t HostObject_info = { - .class = JSCLASS_OBJECT, + .class = JSCLASS_HOST, .addref = HostObject_addref, .release = HostObject_release, .lookup_prop = HostObject_lookup_prop, diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 1cb423cff31..456f00171ed 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -119,6 +119,7 @@ typedef enum { JSCLASS_MAP, JSCLASS_SET, JSCLASS_WEAKMAP, + JSCLASS_HOST, } jsclass_t;
jsdisp_t *iface_to_jsdisp(IDispatch*); diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index da544c6b1c3..feeff5c294a 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -55,7 +55,8 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns L"[object Object]", L"[object Object]", L"[object Object]", - L"[object Object]" + L"[object Object]", + NULL };
TRACE("\n");
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=147318
Your paranoid android.
=== debian11b (64 bit WoW report) ===
user32: input.c:4305: Test succeeded inside todo block: button_down_hwnd_todo 1: got MSG_TEST_WIN hwnd 00000000025B00F4, msg WM_LBUTTONDOWN, wparam 0x1, lparam 0x320032