[PATCH v3 8/8] jscript: Return the correct string for Object.toString(undefined) in ES5+ modes.
Gabriel Ivăncescu
gabrielopcode at gmail.com
Tue Dec 7 13:10:09 CST 2021
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
dlls/jscript/object.c | 2 +-
dlls/mshtml/tests/es5.js | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c
index f48c3c1..03c1366 100644
--- a/dlls/jscript/object.c
+++ b/dlls/jscript/object.c
@@ -58,7 +58,7 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns
if(is_undefined(vthis) || is_null(vthis)) {
if(ctx->version >= SCRIPTLANGUAGEVERSION_ES5)
- str = is_null(vthis) ? L"[object Null]" : L"[object Object]";
+ str = is_null(vthis) ? L"[object Null]" : L"[object Undefined]";
goto set_output;
}
diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js
index fd45362..ad71b13 100644
--- a/dlls/mshtml/tests/es5.js
+++ b/dlls/mshtml/tests/es5.js
@@ -807,10 +807,8 @@ sync_test("toString", function() {
tmp = Object.prototype.toString.call(null);
ok(tmp === "[object Null]", "toString.call(null) = " + tmp);
tmp = Object.prototype.toString.call(undefined);
- todo_wine.
ok(tmp === "[object Undefined]", "toString.call(undefined) = " + tmp);
tmp = Object.prototype.toString.call();
- todo_wine.
ok(tmp === "[object Undefined]", "toString.call() = " + tmp);
obj = Object.create(null);
--
2.31.1
More information about the wine-devel
mailing list