RESOLVED FIXED 21362
"this" object in methods called on primitives should be wrapper object
https://bugs.webkit.org/show_bug.cgi?id=21362
Summary "this" object in methods called on primitives should be wrapper object
Maciej Stachowiak
Reported 2008-10-03 23:58:09 PDT
In cases like this: String.prototype.thisType = function() { return typeof this; }; Number.prototype.thisType = function() { return typeof this; }; Boolean.prototype.thisType = function() { return typeof this; }; shouldBe("(1).thisType()", "'object'"); shouldBe("(2.3).thisType()", "'object'"); shouldBe("'xxx'.thisType()", "'object'"); shouldBe("(false).thisType()", "'object'"); We're currently providing the raw number or string or bool as the "this" value, which is subtly wrong.
Attachments
the fix, with test case (23.10 KB, patch)
2008-10-04 00:02 PDT, Maciej Stachowiak
zwarich: review+
Maciej Stachowiak
Comment 1 2008-10-04 00:02:11 PDT
Created attachment 24084 [details] the fix, with test case
Cameron Zwarich (cpst)
Comment 2 2008-10-04 00:12:16 PDT
Comment on attachment 24084 [details] the fix, with test case r=me
Cameron Zwarich (cpst)
Comment 3 2008-10-04 08:58:32 PDT
Landed in r37285.
Note You need to log in before you can comment on or make changes to this bug.