Rather than always returning "[object]" in every mode.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
This is needed for next patch (and matches native).
dlls/mshtml/dispex.c | 14 ++++++++------ dlls/mshtml/tests/dom.c | 6 +++++- 2 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c index 1adcc67..96a776d 100644 --- a/dlls/mshtml/dispex.c +++ b/dlls/mshtml/dispex.c @@ -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; diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 3bae9e0..9daaf9d 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -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};