Module: wine Branch: master Commit: 52ac3b3bf02792c998cc8687de43e0d8ab107074 URL: http://source.winehq.org/git/wine.git/?a=commit;h=52ac3b3bf02792c998cc8687de...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Sep 24 00:45:21 2009 +0200
jscript: Added Object.toString implementation for variable object.
---
dlls/jscript/object.c | 2 +- dlls/jscript/tests/api.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/jscript/object.c b/dlls/jscript/object.c index f5bc455..8dbae52 100644 --- a/dlls/jscript/object.c +++ b/dlls/jscript/object.c @@ -51,7 +51,7 @@ static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, D static const WCHAR regexpW[] = {'R','e','g','E','x','p',0}; static const WCHAR stringW[] = {'S','t','r','i','n','g',0}; /* Keep in sync with jsclass_t enum */ - static const WCHAR *names[] = {NULL, arrayW, booleanW, dateW, errorW, + static const WCHAR *names[] = {objectW, arrayW, booleanW, dateW, errorW, functionW, NULL, mathW, numberW, objectW, regexpW, stringW, objectW};
TRACE("\n"); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index aed26ec..5b215f5 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -88,7 +88,11 @@ ok(tmp.f() === "[object RegExp]", "tmp.f() = " + tmp.f()); (tmp = new String).f = Object.prototype.toString; ok(tmp.f() === "[object String]", "tmp.f() = " + tmp.f()); tmp = Object.prototype.toString.call(testObj); -ok(tmp === "[object Object]", "'' + new Object() = " + tmp); +ok(tmp === "[object Object]", "toString.call(testObj) = " + tmp); +tmp = Object.prototype.toString.call(this); +ok(tmp === "[object Object]", "toString.call(this) = " + tmp); +(function () { tmp = Object.prototype.toString.call(arguments); })(); +ok(tmp === "[object Object]", "toString.call(arguments) = " + tmp);
ok(Object(1) instanceof Number, "Object(1) is not instance of Number"); ok(Object("") instanceof String, "Object('') is not instance of String");