Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com ---
I kept the check in Object_toString, because that's what the spec says and special cases before calling to_object, and it's changed from version ES3 to ES5.
dlls/jscript/object.c | 5 ++++- dlls/mshtml/tests/documentmode.js | 2 +- dlls/mshtml/tests/es5.js | 1 - 3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index 8426c16..f48c3c1 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -56,8 +56,11 @@ static HRESULT Object_toString(script_ctx_t *ctx, jsval_t vthis, WORD flags, uns
TRACE("\n");
- if(is_undefined(vthis) || is_null(vthis)) + if(is_undefined(vthis) || is_null(vthis)) { + if(ctx->version >= SCRIPTLANGUAGEVERSION_ES5) + str = is_null(vthis) ? L"[object Null]" : L"[object Object]"; goto set_output; + }
hres = to_object(ctx, vthis, &disp); if(FAILED(hres)) diff --git a/dlls/mshtml/tests/documentmode.js b/dlls/mshtml/tests/documentmode.js index 2af5fae..8f96222 100644 --- a/dlls/mshtml/tests/documentmode.js +++ b/dlls/mshtml/tests/documentmode.js @@ -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);
diff --git a/dlls/mshtml/tests/es5.js b/dlls/mshtml/tests/es5.js index f5d23b0..1da2eeb 100644 --- a/dlls/mshtml/tests/es5.js +++ b/dlls/mshtml/tests/es5.js @@ -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.