mshtml: Use dispex_to_string when retrieving the value of an object.

Rather than always returning "[object]" in every mode.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2021-10-06 18:11:33 +03:00 committed by Alexandre Julliard
parent c667bbe80a
commit d9eb90e6ab
2 changed files with 13 additions and 7 deletions

View File

@ -715,15 +715,17 @@ HRESULT dispex_get_dynid(DispatchEx *This, const WCHAR *name, DISPID *id)
static HRESULT dispex_value(DispatchEx *This, LCID lcid, WORD flags, DISPPARAMS *params,
VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
{
HRESULT hres;
if(This->info->desc->vtbl && This->info->desc->vtbl->value)
return This->info->desc->vtbl->value(This, lcid, flags, params, res, ei, caller);
switch(flags) {
case DISPATCH_PROPERTYGET:
V_VT(res) = VT_BSTR;
V_BSTR(res) = SysAllocString(L"[object]");
if(!V_BSTR(res))
return E_OUTOFMEMORY;
hres = dispex_to_string(This, &V_BSTR(res));
if(FAILED(hres))
return hres;
break;
default:
FIXME("Unimplemented flags %x\n", flags);
@ -1305,9 +1307,9 @@ static HRESULT function_invoke(DispatchEx *This, func_info_t *func, WORD flags,
if(func->id == DISPID_VALUE) {
BSTR ret;
ret = SysAllocString(L"[object]");
if(!ret)
return E_OUTOFMEMORY;
hres = dispex_to_string(This, &ret);
if(FAILED(hres))
return hres;
V_VT(res) = VT_BSTR;
V_BSTR(res) = ret;

View File

@ -107,7 +107,11 @@ static const char noscript_str[] =
"<body><noscript><div>test</div></noscript></body></html>";
static const char doctype_str[] =
"<!DOCTYPE html>"
"<html><head><title>emptydiv test</title></head>"
"<html>"
" <head>"
" <meta http-equiv=\"x-ua-compatible\" content=\"IE=8\" />"
" <title>emptydiv test</title>"
" </head>"
"<body><div id=\"divid\"></div></body></html>";
static WCHAR characterW[] = {'c','h','a','r','a','c','t','e','r',0};