Commit 22ce4d7e authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

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

parent 8fa923ca
......@@ -57,7 +57,10 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns
TRACE("\n");
if(is_undefined(vthis) || is_null(vthis)) {
if(ctx->version < SCRIPTLANGUAGEVERSION_ES5)
str = L"[object Object]";
else
str = is_null(vthis) ? L"[object Null]" : L"[object Object]";
goto set_output;
}
......
......@@ -1243,7 +1243,7 @@ sync_test("elem_attr", function() {
r = elem.removeAttribute("ondblclick");
ok(r === (v < 8 ? false : (v < 9 ? true : undefined)), "ondblclick removeAttribute returned " + r);
r = Object.prototype.toString.call(elem.ondblclick);
todo_wine_if(v >= 9).
todo_wine_if(v >= 11).
ok(r === (v < 8 ? "[object Array]" : (v < 9 ? "[object Object]" : (v < 11 ? "[object Null]" : "[object Function]"))),
"removed ondblclick Object.toString returned " + r);
......
......@@ -805,7 +805,6 @@ sync_test("toString", function() {
todo_wine.
ok(tmp === "[object Window]", "toString.call(null) = " + tmp);
tmp = Object.prototype.toString.call(null);
todo_wine.
ok(tmp === "[object Null]", "toString.call(null) = " + tmp);
tmp = Object.prototype.toString.call(undefined);
todo_wine.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment