jscript: Return the correct string for Object.toString(undefined) in ES5+ modes.

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 2022-03-18 17:24:11 +02:00 committed by Alexandre Julliard
parent 598709f872
commit 47b02e8c1e
2 changed files with 1 additions and 3 deletions

View File

@ -60,7 +60,7 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns
if(ctx->version < SCRIPTLANGUAGEVERSION_ES5)
str = L"[object Object]";
else
str = is_null(vthis) ? L"[object Null]" : L"[object Object]";
str = is_null(vthis) ? L"[object Null]" : L"[object Undefined]";
goto set_output;
}

View File

@ -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);