jscript: Added Object.toString implementation for variable object.
This commit is contained in:
parent
c168918d75
commit
52ac3b3bf0
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Reference in New Issue