WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
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+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
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.
Top of Page
Format For Printing
XML
Clone This Bug