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.
Created attachment 24084 [details] the fix, with test case
Comment on attachment 24084 [details] the fix, with test case r=me
Landed in r37285.