Index: test/webkit/primitive-method-this.js |
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/primitive-method-this.js |
similarity index 74% |
copy from test/webkit/concat-while-having-a-bad-time.js |
copy to test/webkit/primitive-method-this.js |
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..ffffdd74d50779416e7b0e8a34ee11009e8b3893 100644 |
--- a/test/webkit/concat-while-having-a-bad-time.js |
+++ b/test/webkit/primitive-method-this.js |
@@ -22,10 +22,17 @@ |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
description( |
-"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating." |
+ |
+"This test checks that methods called directly on primitive types get the wrapper, not the primitive, as the 'this' object." |
+ |
); |
-Object.defineProperty(Array.prototype, 0, { writable: false }); |
-shouldBe("[42].concat()", "[42]"); |
+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'"); |