mshtml: Fix navigator.toString() in IE9+ compat modes.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-03-26 16:34:06 +01:00 committed by Alexandre Julliard
parent 53cc70caa4
commit 4238faa0a0
2 changed files with 4 additions and 1 deletions

View File

@ -1315,7 +1315,8 @@ static HRESULT WINAPI OmNavigator_toString(IOmNavigator *iface, BSTR *String)
if(!String)
return E_INVALIDARG;
*String = SysAllocString(L"[object]");
*String = SysAllocString(dispex_compat_mode(&This->dispex) < COMPAT_MODE_IE9
? L"[object]" : L"[object Navigator]");
return *String ? S_OK : E_OUTOFMEMORY;
}

View File

@ -375,4 +375,6 @@ sync_test("navigator", function() {
ok(navigator.appCodeName === "Mozilla", "appCodeName = " + navigator.appCodeName);
ok(navigator.appName === (v < 11 ? "Microsoft Internet Explorer" : "Netscape"),
"appName = " + navigator.appName);
ok(navigator.toString() === (v < 9 ? "[object]" : "[object Navigator]"),
"navigator.toString() = " + navigator.toString());
});